Package org.codehaus.janino
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
public static interface Java.TypeDeclaration extends Java.Annotatable, Java.Locatable, Java.Scope
Base for the various kinds of type declarations, e.g. top-level class, member interface, local class.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <R,EX extends java.lang.Throwable>
Raccept(Visitor.TypeDeclarationVisitor<R,EX> visitor)Invokes the "visit...()" method ofVisitor.TypeDeclarationVisitorfor the concreteJava.TypeDeclarationtype.java.lang.StringcreateAnonymousClassName()Creates a unique name for an anonymous class.java.lang.StringcreateLocalTypeName(java.lang.String localTypeName)Creates a unique name for a local class or interface.java.lang.StringgetClassName()Determines the effective class name, e.g.Java.MemberTypeDeclarationgetMemberTypeDeclaration(java.lang.String name)Returns the member type with the given name.java.util.Collection<Java.MemberTypeDeclaration>getMemberTypeDeclarations()Java.MethodDeclaratorgetMethodDeclaration(java.lang.String name)Returns the first method declared with the given name.java.util.List<Java.MethodDeclarator>getMethodDeclarations()-
Methods inherited from interface org.codehaus.janino.Java.Annotatable
getAnnotations
-
Methods inherited from interface org.codehaus.janino.Java.Locatable
getLocation, throwCompileException
-
Methods inherited from interface org.codehaus.janino.Java.Scope
getEnclosingScope
-
-
-
-
Method Detail
-
getMemberTypeDeclaration
@Nullable Java.MemberTypeDeclaration getMemberTypeDeclaration(java.lang.String name)
Returns the member type with the given name.- Returns:
nullif a member type with that name is not declared
-
getMemberTypeDeclarations
java.util.Collection<Java.MemberTypeDeclaration> getMemberTypeDeclarations()
- Returns:
- The (possibly empty) set of member types declared inside this
Java.TypeDeclaration
-
getMethodDeclaration
@Nullable Java.MethodDeclarator getMethodDeclaration(java.lang.String name)
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
java.util.List<Java.MethodDeclarator> getMethodDeclarations()
- Returns:
- The list of methods declared in this
Java.TypeDeclaration, not including methods declared in supertypes
-
getClassName
java.lang.String getClassName()
Determines the effective class name, e.g. "pkg.Outer$Inner".
-
createLocalTypeName
java.lang.String createLocalTypeName(java.lang.String localTypeName)
Creates a unique name for a local class or interface.
-
createAnonymousClassName
java.lang.String createAnonymousClassName()
Creates a unique name for an anonymous class.
-
accept
@Nullable <R,EX extends java.lang.Throwable> R accept(Visitor.TypeDeclarationVisitor<R,EX> visitor) throws EX extends java.lang.Throwable
Invokes the "visit...()" method ofVisitor.TypeDeclarationVisitorfor the concreteJava.TypeDeclarationtype.- Throws:
EX extends java.lang.Throwable
-
-