| 1 | /* |
|---|---|
| 2 | * Copyright (C) 2007-2010 JĂșlio Vilmar Gesser. |
| 3 | * Copyright (C) 2011, 2013-2020 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 | import java.util.Optional; |
| 29 | |
| 30 | /** |
| 31 | * Declaration of a Class (not an interface or an enum). |
| 32 | * |
| 33 | * Note that it can be associated to a Node AST because anonymous class declarations return an incompatible |
| 34 | * node type, compared to classic class declarations. |
| 35 | * |
| 36 | * @author Federico Tomassetti |
| 37 | */ |
| 38 | public interface ResolvedClassDeclaration extends ResolvedReferenceTypeDeclaration, |
| 39 | ResolvedTypeParametrizable, HasAccessSpecifier, AssociableToAST<Node> { |
| 40 | |
| 41 | /** |
| 42 | * This method should always return true. |
| 43 | */ |
| 44 | @Override |
| 45 | default boolean isClass() { |
| 46 | return true; |
| 47 | } |
| 48 | |
| 49 | /** |
| 50 | * This is a ReferenceTypeUsage because it could contain type typeParametersValues. |
| 51 | * For example: {@code class A extends B<Integer, String>}. |
| 52 | * <p> |
| 53 | * Note that only the Object class should not have a superclass and therefore |
| 54 | * return empty. |
| 55 | */ |
| 56 | Optional<ResolvedReferenceType> getSuperClass(); |
| 57 | |
| 58 | /** |
| 59 | * Return all the interfaces implemented directly by this class. |
| 60 | * It does not include the interfaces implemented by superclasses or extended |
| 61 | * by the interfaces implemented. |
| 62 | */ |
| 63 | List<ResolvedReferenceType> getInterfaces(); |
| 64 | |
| 65 | /** |
| 66 | * Get all superclasses, with all the type typeParametersValues expressed as functions of the type |
| 67 | * typeParametersValues of this declaration. |
| 68 | */ |
| 69 | List<ResolvedReferenceType> getAllSuperClasses(); |
| 70 | |
| 71 | /** |
| 72 | * Return all the interfaces implemented by this class, either directly or indirectly, including the interfaces |
| 73 | * extended by interfaces it implements. |
| 74 | * <p> |
| 75 | * Get all interfaces, with all the type typeParametersValues expressed as functions of the type |
| 76 | * typeParametersValues of this declaration. |
| 77 | */ |
| 78 | List<ResolvedReferenceType> getAllInterfaces(); |
| 79 | |
| 80 | /// |
| 81 | /// Constructors |
| 82 | /// |
| 83 | |
| 84 | /** |
| 85 | * List of constructors available for the class. |
| 86 | * This list should also include the default constructor. |
| 87 | */ |
| 88 | @Override |
| 89 | List<ResolvedConstructorDeclaration> getConstructors(); |
| 90 | |
| 91 | } |
| 92 |
Members