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 java.lang.Object implements Java.TypeDeclaration
-
-
Field Summary
Fields Modifier and Type Field Description intanonymousClassCountintlocalClassCount
-
Constructor Summary
Constructors Constructor Description AbstractTypeDeclaration(Location location, Java.ModifiersAndAnnotations modifiersAndAnnotations)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddDeclaredMethod(Java.MethodDeclarator method)voidaddMemberTypeDeclaration(Java.MemberTypeDeclaration mcoid)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.ScopegetEnclosingScope()LocationgetLocation()Java.MemberTypeDeclarationgetMemberTypeDeclaration(java.lang.String name)Return the member type with the given name.java.util.CollectiongetMemberTypeDeclarations()Java.MethodDeclaratorgetMethodDeclaration(java.lang.String name)Return the first method declared with the given name.java.util.ListgetMethodDeclarations()Java.ModifiersAndAnnotationsgetModifiersAndAnnotations()voidinvalidateMethodCaches()voidsetEnclosingScope(Java.Scope enclosingScope)voidthrowCompileException(java.lang.String message)Throw aCompileExceptionwith the given message and this object's location.abstract java.lang.StringtoString()-
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
-
-
-
-
Constructor Detail
-
AbstractTypeDeclaration
public AbstractTypeDeclaration(Location location, Java.ModifiersAndAnnotations modifiersAndAnnotations)
-
-
Method Detail
-
getModifiersAndAnnotations
public Java.ModifiersAndAnnotations getModifiersAndAnnotations()
- Specified by:
getModifiersAndAnnotationsin interfaceJava.TypeDeclaration
-
setEnclosingScope
public void setEnclosingScope(Java.Scope enclosingScope)
-
getEnclosingScope
public Java.Scope getEnclosingScope()
- Specified by:
getEnclosingScopein interfaceJava.Scope
-
invalidateMethodCaches
public void invalidateMethodCaches()
-
addMemberTypeDeclaration
public void addMemberTypeDeclaration(Java.MemberTypeDeclaration mcoid)
-
getMemberTypeDeclarations
public java.util.Collection getMemberTypeDeclarations()
- Specified by:
getMemberTypeDeclarationsin interfaceJava.TypeDeclaration
-
getMemberTypeDeclaration
public Java.MemberTypeDeclaration getMemberTypeDeclaration(java.lang.String name)
Description copied from interface:Java.TypeDeclarationReturn the member type with the given name.- Specified by:
getMemberTypeDeclarationin interfaceJava.TypeDeclaration- Returns:
nullif a member type with that name is not declared
-
addDeclaredMethod
public void addDeclaredMethod(Java.MethodDeclarator method)
-
getMethodDeclaration
public Java.MethodDeclarator getMethodDeclaration(java.lang.String name)
Description copied from interface:Java.TypeDeclarationReturn the first method declared with the given name. (Does not honor inherited methods.)- Specified by:
getMethodDeclarationin interfaceJava.TypeDeclaration- Returns:
nullif a method with this name is not declared
-
getMethodDeclarations
public java.util.List getMethodDeclarations()
- Specified by:
getMethodDeclarationsin interfaceJava.TypeDeclaration
-
createLocalTypeName
public java.lang.String createLocalTypeName(java.lang.String localTypeName)
Description copied from interface:Java.TypeDeclarationCreates a unique name for a local class or interface.- Specified by:
createLocalTypeNamein interfaceJava.TypeDeclaration
-
createAnonymousClassName
public java.lang.String createAnonymousClassName()
Description copied from interface:Java.TypeDeclarationCreates a unique name for an anonymous class.- Specified by:
createAnonymousClassNamein interfaceJava.TypeDeclaration
-
getLocation
public Location getLocation()
- Specified by:
getLocationin interfaceJava.Locatable
-
throwCompileException
public void throwCompileException(java.lang.String message) throws CompileExceptionDescription copied from interface:Java.LocatableThrow aCompileExceptionwith the given message and this object's location.- Specified by:
throwCompileExceptionin interfaceJava.Locatable- Parameters:
message- The message to report- Throws:
CompileException
-
toString
public abstract java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-