Package org.codehaus.janino
Interface Java.TypeDeclaration
-
- All Superinterfaces:
Java.Locatable,Java.Scope
- All Known Subinterfaces:
Java.MemberTypeDeclaration,Java.NamedTypeDeclaration,Java.PackageMemberTypeDeclaration
- All Known Implementing Classes:
Java.AbstractTypeDeclaration,Java.AnonymousClassDeclaration,Java.ClassDeclaration,Java.InterfaceDeclaration,Java.LocalClassDeclaration,Java.MemberClassDeclaration,Java.MemberInterfaceDeclaration,Java.NamedClassDeclaration,Java.PackageMemberClassDeclaration,Java.PackageMemberInterfaceDeclaration
- Enclosing class:
- Java
public static interface Java.TypeDeclaration extends 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 voidaccept(Visitor.TypeDeclarationVisitor visitor)Invokes the 'visit...()' method ofVisitor.TypeDeclarationVisitorfor the concreteJava.TypeDeclarationtype.StringcreateAnonymousClassName()Creates a unique name for an anonymous class.StringcreateLocalTypeName(String localTypeName)Creates a unique name for a local class or interface.Java.Annotation[]getAnnotations()StringgetClassName()Determines the effective class name, e.g.Java.MemberTypeDeclarationgetMemberTypeDeclaration(String name)Return the member type with the given name.Collection<Java.MemberTypeDeclaration>getMemberTypeDeclarations()Java.MethodDeclaratorgetMethodDeclaration(String name)Return the first method declared with the given name.List<Java.MethodDeclarator>getMethodDeclarations()shortgetModifierFlags()-
Methods inherited from interface org.codehaus.janino.Java.Locatable
getLocation, throwCompileException
-
Methods inherited from interface org.codehaus.janino.Java.Scope
getEnclosingScope
-
-
-
-
Method Detail
-
getModifierFlags
short getModifierFlags()
- Returns:
- The or'ed modifier flags of the type, as defined in
Mod
-
getAnnotations
Java.Annotation[] getAnnotations()
- Returns:
- The annotations of this
Java.TypeDeclaration
-
getMemberTypeDeclaration
Java.MemberTypeDeclaration getMemberTypeDeclaration(String name)
Return 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
Java.MethodDeclarator getMethodDeclaration(String name)
Return 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
String createLocalTypeName(String localTypeName)
Creates a unique name for a local class or interface.
-
createAnonymousClassName
String createAnonymousClassName()
Creates a unique name for an anonymous class.
-
accept
void accept(Visitor.TypeDeclarationVisitor visitor)
Invokes the 'visit...()' method ofVisitor.TypeDeclarationVisitorfor the concreteJava.TypeDeclarationtype.
-
-