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
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.TypeDeclarationVisitor
for the concreteJava.TypeDeclaration
type.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 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 Details
-
getMemberTypeDeclaration
Returns the member type with the given name.- Returns:
null
if 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:
null
if 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
Creates a unique name for a local class or interface. -
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.TypeDeclarationVisitor
for the concreteJava.TypeDeclaration
type.- Throws:
EX extends Throwable
-