1 /* 2 * Copyright 2016 Federico Tomassetti 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.github.javaparser.symbolsolver.model.declarations; 18 19 import com.github.javaparser.symbolsolver.model.typesystem.ReferenceType; 20 21 import java.util.List; 22 23 /** 24 * Declaration of a Class (not an interface or an enum). 25 * 26 * @author Federico Tomassetti 27 */ 28 public interface ClassDeclaration extends ReferenceTypeDeclaration, TypeParametrizable, HasAccessLevel { 29 30 /** 31 * This method should always return true. 32 */ 33 @Override isClass()34 default boolean isClass() { 35 return true; 36 } 37 38 /** 39 * This is a ReferenceTypeUsage because it could contain type typeParametersValues. 40 * For example: class A extends B<Integer, String>. 41 * <p> 42 * Note that only the Object class should not have a superclass and therefore 43 * return null. 44 */ getSuperClass()45 ReferenceType getSuperClass(); 46 47 /** 48 * Return all the interfaces implemented directly by this class. 49 * It does not include the interfaces implemented by superclasses or extended 50 * by the interfaces implemented. 51 */ getInterfaces()52 List<ReferenceType> getInterfaces(); 53 54 /** 55 * Get all superclasses, with all the type typeParametersValues expressed as functions of the type 56 * typeParametersValues of this declaration. 57 */ getAllSuperClasses()58 List<ReferenceType> getAllSuperClasses(); 59 60 /** 61 * Return all the interfaces implemented by this class, either directly or indirectly, including the interfaces 62 * extended by interfaces it implements. 63 * <p> 64 * Get all interfaces, with all the type typeParametersValues expressed as functions of the type 65 * typeParametersValues of this declaration. 66 */ getAllInterfaces()67 List<ReferenceType> getAllInterfaces(); 68 69 /// 70 /// Constructors 71 /// 72 73 /** 74 * List of constructors available for the class. 75 * This list should also include the default constructor. 76 */ getConstructors()77 List<ConstructorDeclaration> getConstructors(); 78 79 } 80