Package org.codehaus.janino
Class Java.AbstractTypeDeclaration
java.lang.Object
org.codehaus.janino.Java.AbstractTypeDeclaration
- All Implemented Interfaces:
Java.Locatable
,Java.Scope
,Java.TypeDeclaration
- Direct Known Subclasses:
Java.ClassDeclaration
,Java.InterfaceDeclaration
- Enclosing class:
- Java
public abstract static class Java.AbstractTypeDeclaration
extends Object
implements Java.TypeDeclaration
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAbstractTypeDeclaration
(Location location, Java.ModifiersAndAnnotations modifiersAndAnnotations) -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
Creates a unique name for an anonymous class.createLocalTypeName
(String localTypeName) Creates a unique name for a local class or interface.Return the member type with the given name.getMethodDeclaration
(String name) Return the first method declared with the given name.void
void
setEnclosingScope
(Java.Scope enclosingScope) void
throwCompileException
(String message) Throw aCompileException
with the given message and this object's location.abstract String
toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.codehaus.janino.Java.TypeDeclaration
accept, getClassName
-
Field Details
-
anonymousClassCount
public int anonymousClassCount -
localClassCount
public int localClassCount
-
-
Constructor Details
-
AbstractTypeDeclaration
public AbstractTypeDeclaration(Location location, Java.ModifiersAndAnnotations modifiersAndAnnotations)
-
-
Method Details
-
getModifiersAndAnnotations
- Specified by:
getModifiersAndAnnotations
in interfaceJava.TypeDeclaration
-
setEnclosingScope
-
getEnclosingScope
- Specified by:
getEnclosingScope
in interfaceJava.Scope
-
invalidateMethodCaches
public void invalidateMethodCaches() -
addMemberTypeDeclaration
-
getMemberTypeDeclarations
- Specified by:
getMemberTypeDeclarations
in interfaceJava.TypeDeclaration
-
getMemberTypeDeclaration
Description copied from interface:Java.TypeDeclaration
Return the member type with the given name.- Specified by:
getMemberTypeDeclaration
in interfaceJava.TypeDeclaration
- Returns:
null
if a member type with that name is not declared
-
addDeclaredMethod
-
getMethodDeclaration
Description copied from interface:Java.TypeDeclaration
Return the first method declared with the given name. (Does not honor inherited methods.)- Specified by:
getMethodDeclaration
in interfaceJava.TypeDeclaration
- Returns:
null
if a method with this name is not declared
-
getMethodDeclarations
- Specified by:
getMethodDeclarations
in interfaceJava.TypeDeclaration
-
createLocalTypeName
Description copied from interface:Java.TypeDeclaration
Creates a unique name for a local class or interface.- Specified by:
createLocalTypeName
in interfaceJava.TypeDeclaration
-
createAnonymousClassName
Description copied from interface:Java.TypeDeclaration
Creates a unique name for an anonymous class.- Specified by:
createAnonymousClassName
in interfaceJava.TypeDeclaration
-
getLocation
- Specified by:
getLocation
in interfaceJava.Locatable
-
throwCompileException
Description copied from interface:Java.Locatable
Throw aCompileException
with the given message and this object's location.- Specified by:
throwCompileException
in interfaceJava.Locatable
- Parameters:
message
- The message to report- Throws:
CompileException
-
toString
-