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.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.TypeDeclarationVisitor
for the concreteJava.TypeDeclaration
type.java.lang.String
createAnonymousClassName()
Creates a unique name for an anonymous class.java.lang.String
createLocalTypeName(java.lang.String localTypeName)
Creates a unique name for a local class or interface.java.lang.String
getClassName()
Determines the effective class name, e.g.Java.MemberTypeDeclaration
getMemberTypeDeclaration(java.lang.String name)
Returns the member type with the given name.java.util.Collection<Java.MemberTypeDeclaration>
getMemberTypeDeclarations()
Java.MethodDeclarator
getMethodDeclaration(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:
null
if 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:
null
if 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.TypeDeclarationVisitor
for the concreteJava.TypeDeclaration
type.- Throws:
EX extends java.lang.Throwable
-
-