• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2007-2010 Júlio Vilmar Gesser.
3  * Copyright (C) 2011, 2013-2016 The JavaParser Team.
4  *
5  * This file is part of JavaParser.
6  *
7  * JavaParser can be used either under the terms of
8  * a) the GNU Lesser General Public License as published by
9  *     the Free Software Foundation, either version 3 of the License, or
10  *     (at your option) any later version.
11  * b) the terms of the Apache License
12  *
13  * You should have received a copy of both licenses in LICENCE.LGPL and
14  * LICENCE.APACHE. Please refer to those files for details.
15  *
16  * JavaParser is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU Lesser General Public License for more details.
20  */
21 
22 package com.github.javaparser.resolution.declarations;
23 
24 import com.github.javaparser.ast.Node;
25 import com.github.javaparser.resolution.types.ResolvedReferenceType;
26 
27 import java.util.List;
28 
29 /**
30  * Declaration of a Class (not an interface or an enum).
31  *
32  * Note that it can be associated to a Node AST because anonymous class declarations return an incompatible
33  * node type, compared to classic class declarations.
34  *
35  * @author Federico Tomassetti
36  */
37 public interface ResolvedClassDeclaration extends ResolvedReferenceTypeDeclaration,
38         ResolvedTypeParametrizable, HasAccessSpecifier, AssociableToAST<Node> {
39 
40     /**
41      * This method should always return true.
42      */
43     @Override
isClass()44     default boolean isClass() {
45         return true;
46     }
47 
48     /**
49      * This is a ReferenceTypeUsage because it could contain type typeParametersValues.
50      * For example: class A extends B<Integer, String>.
51      * <p>
52      * Note that only the Object class should not have a superclass and therefore
53      * return null.
54      */
getSuperClass()55     ResolvedReferenceType getSuperClass();
56 
57     /**
58      * Return all the interfaces implemented directly by this class.
59      * It does not include the interfaces implemented by superclasses or extended
60      * by the interfaces implemented.
61      */
getInterfaces()62     List<ResolvedReferenceType> getInterfaces();
63 
64     /**
65      * Get all superclasses, with all the type typeParametersValues expressed as functions of the type
66      * typeParametersValues of this declaration.
67      */
getAllSuperClasses()68     List<ResolvedReferenceType> getAllSuperClasses();
69 
70     /**
71      * Return all the interfaces implemented by this class, either directly or indirectly, including the interfaces
72      * extended by interfaces it implements.
73      * <p>
74      * Get all interfaces, with all the type typeParametersValues expressed as functions of the type
75      * typeParametersValues of this declaration.
76      */
getAllInterfaces()77     List<ResolvedReferenceType> getAllInterfaces();
78 
79     ///
80     /// Constructors
81     ///
82 
83     /**
84      * List of constructors available for the class.
85      * This list should also include the default constructor.
86      */
87     @Override
getConstructors()88     List<ResolvedConstructorDeclaration> getConstructors();
89 
90 }
91