Interface Java.TypeDeclaration
- All Superinterfaces:
Java.Annotatable, Java.Locatable, Java.Scope
- All Known Subinterfaces:
Java.AnnotationTypeDeclaration, Java.ClassDeclaration, Java.EnumDeclaration, Java.InnerClassDeclaration, Java.MemberTypeDeclaration, Java.NamedTypeDeclaration, Java.PackageMemberTypeDeclaration
- All Known Implementing Classes:
Java.AbstractClassDeclaration, Java.AbstractTypeDeclaration, Java.AnonymousClassDeclaration, Java.EnumConstant, Java.InterfaceDeclaration, Java.LocalClassDeclaration, Java.MemberAnnotationTypeDeclaration, Java.MemberClassDeclaration, Java.MemberEnumDeclaration, Java.MemberInterfaceDeclaration, Java.NamedClassDeclaration, Java.PackageMemberAnnotationTypeDeclaration, Java.PackageMemberClassDeclaration, Java.PackageMemberEnumDeclaration, Java.PackageMemberInterfaceDeclaration
- Enclosing class:
Java
Base for the various kinds of type declarations, e.g. top-level class, member interface, local class.
-
Method Summary
Modifier and TypeMethodDescription<R, EX extends Throwable>
Raccept(Visitor.TypeDeclarationVisitor<R, EX> visitor) Invokes the "visit...()" method ofVisitor.TypeDeclarationVisitorfor the concreteJava.TypeDeclarationtype.Creates a unique name for an anonymous class.createLocalTypeName(String localTypeName) Creates a unique name for a local class or interface.Determines the effective class name, e.g.Returns the member type with the given name.getMethodDeclaration(String name) Returns the first method declared with the given name.Methods inherited from interface Java.Annotatable
getAnnotationsMethods inherited from interface Java.Locatable
getLocation, throwCompileExceptionMethods inherited from interface Java.Scope
getEnclosingScope
-
Method Details
-
getMemberTypeDeclaration
Returns the member type with the given name.- Returns:
nullif a member type with that name is not declared
-
getMemberTypeDeclarations
Collection<Java.MemberTypeDeclaration> getMemberTypeDeclarations()- Returns:
- The (possibly empty) set of member types declared inside this
Java.TypeDeclaration
-
getMethodDeclaration
Returns the first method declared with the given name. (Does not honor inherited methods.)- Returns:
nullif a method with this name is not declared
-
getMethodDeclarations
List<Java.MethodDeclarator> getMethodDeclarations()- Returns:
- The list of methods declared in this
Java.TypeDeclaration, not including methods declared in supertypes
-
getClassName
String getClassName()Determines the effective class name, e.g. "pkg.Outer$Inner". -
createLocalTypeName
-
createAnonymousClassName
String createAnonymousClassName()Creates a unique name for an anonymous class. -
accept
@Nullable <R, EX extends Throwable> R accept(Visitor.TypeDeclarationVisitor<R, EX> visitor) throws EXInvokes the "visit...()" method ofVisitor.TypeDeclarationVisitorfor the concreteJava.TypeDeclarationtype.- Throws:
EX
-