View Javadoc
1   /*
2    * Copyright (C) 2015 Uwe Plonus
3    *
4    * This program is free software: you can redistribute it and/or modify
5    * it under the terms of the GNU General Public License as published by
6    * the Free Software Foundation, either version 3 of the License, or
7    * (at your option) any later version.
8    *
9    * This program is distributed in the hope that it will be useful,
10   * but WITHOUT ANY WARRANTY; without even the implied warranty of
11   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12   * GNU General Public License for more details.
13   *
14   * You should have received a copy of the GNU General Public License
15   * along with this program.  If not, see <http://www.gnu.org/licenses/>.
16   */
17  package org.sw4j.apisniffer.builder;
18  
19  import java.util.Collection;
20  import javax.annotation.concurrent.Immutable;
21  import javax.annotation.concurrent.NotThreadSafe;
22  import org.sw4j.apisniffer.api.Api;
23  import org.sw4j.apisniffer.api.Type;
24  
25  /**
26   * This is a builder to create an {@link Api} object.
27   *
28   * @author Uwe Plonus &lt;u.plonus@gmail.com&gt;
29   */
30  @NotThreadSafe
31  public final class ApiBuilder {
32  
33      public ClassTypeBuilder createClassTypeBuilder() {
34          return new ClassTypeBuilder();
35      }
36  
37      public InterfaceTypeBuilder createInterfaceTypeBuilder() {
38          return new InterfaceTypeBuilder();
39      }
40  
41      public EnumTypeBuilder createEnumTypeBuilder() {
42          return new EnumTypeBuilder();
43      }
44  
45      public AnnotationTypeBuilder createAnnotationTypeBuilder() {
46          return new AnnotationTypeBuilder();
47      }
48  
49      /**
50       * Builds an {@link Api} object.
51       *
52       * @return the built API object.
53       */
54      public Api build() {
55          return null;
56      }
57  
58  
59      /**
60       * A concrete implementation of the {@link Api} interface.
61       */
62      @Immutable
63      private static final class ApiImpl implements Api {
64  
65          /**
66           * Returns all types (classes, enums, interfaces, annotations) of this API.
67           *
68           * @return all types of this API.
69           */
70          @Override
71          public Collection<Type> getTypes() {
72              throw new UnsupportedOperationException("Not supported yet.");
73          }
74  
75      }
76  
77  }