public abstract static class Java.AbstractTypeDeclaration extends java.lang.Object implements Java.TypeDeclaration
Java.TypeDeclaration
.Modifier and Type | Field and Description |
---|---|
int |
anonymousClassCount
For naming anonymous classes.
|
private java.util.List<Java.MemberTypeDeclaration> |
declaredClassesAndInterfaces |
private java.util.List<Java.MethodDeclarator> |
declaredMethods |
private Java.Scope |
enclosingScope |
int |
localClassCount
For naming local classes.
|
private Location |
location |
private Java.Modifiers |
modifiers |
(package private) IClass |
resolvedType
Holds the resolved type during compilation.
|
Constructor and Description |
---|
AbstractTypeDeclaration(Location location,
Java.Modifiers modifiers) |
Modifier and Type | Method and Description |
---|---|
void |
addDeclaredMethod(Java.MethodDeclarator method)
Adds one
Java.MethodDeclarator to this type. |
void |
addMemberTypeDeclaration(Java.MemberTypeDeclaration mcoid)
Adds one
Java.MemberTypeDeclaration to this 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.Annotation[] |
getAnnotations() |
Java.Scope |
getEnclosingScope() |
Location |
getLocation() |
Java.MemberTypeDeclaration |
getMemberTypeDeclaration(java.lang.String name)
Return the member type with the given name.
|
java.util.Collection<Java.MemberTypeDeclaration> |
getMemberTypeDeclarations() |
Java.MethodDeclarator |
getMethodDeclaration(java.lang.String name)
Return the first method declared with the given name.
|
java.util.List<Java.MethodDeclarator> |
getMethodDeclarations() |
short |
getModifierFlags() |
void |
invalidateMethodCaches()
Invalidates the method cache of the
resolvedType . |
void |
setEnclosingScope(Java.Scope enclosingScope)
Sets the enclosing scope of this
Java.TypeDeclaration . |
void |
throwCompileException(java.lang.String message)
Throw a
CompileException with the given message and this
object's location. |
abstract java.lang.String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
accept, getClassName
private final Location location
private final Java.Modifiers modifiers
private final java.util.List<Java.MethodDeclarator> declaredMethods
private final java.util.List<Java.MemberTypeDeclaration> declaredClassesAndInterfaces
private Java.Scope enclosingScope
IClass resolvedType
public int anonymousClassCount
public int localClassCount
public AbstractTypeDeclaration(Location location, Java.Modifiers modifiers)
public short getModifierFlags()
getModifierFlags
in interface Java.TypeDeclaration
Mod
public Java.Annotation[] getAnnotations()
getAnnotations
in interface Java.TypeDeclaration
Java.TypeDeclaration
public void setEnclosingScope(Java.Scope enclosingScope)
Java.TypeDeclaration
.public Java.Scope getEnclosingScope()
getEnclosingScope
in interface Java.Scope
null
public void invalidateMethodCaches()
resolvedType
. This is necessary when methods are added
during compilationpublic void addMemberTypeDeclaration(Java.MemberTypeDeclaration mcoid)
Java.MemberTypeDeclaration
to this type.public void addDeclaredMethod(Java.MethodDeclarator method)
Java.MethodDeclarator
to this type.public java.util.Collection<Java.MemberTypeDeclaration> getMemberTypeDeclarations()
getMemberTypeDeclarations
in interface Java.TypeDeclaration
Java.TypeDeclaration
public Java.MemberTypeDeclaration getMemberTypeDeclaration(java.lang.String name)
Java.TypeDeclaration
getMemberTypeDeclaration
in interface Java.TypeDeclaration
null
if a member type with that name is not declaredpublic Java.MethodDeclarator getMethodDeclaration(java.lang.String name)
Java.TypeDeclaration
getMethodDeclaration
in interface Java.TypeDeclaration
null
if a method with this name is not declaredpublic java.util.List<Java.MethodDeclarator> getMethodDeclarations()
getMethodDeclarations
in interface Java.TypeDeclaration
Java.TypeDeclaration
, not including methods declared in
supertypespublic java.lang.String createLocalTypeName(java.lang.String localTypeName)
Java.TypeDeclaration
createLocalTypeName
in interface Java.TypeDeclaration
public java.lang.String createAnonymousClassName()
Java.TypeDeclaration
createAnonymousClassName
in interface Java.TypeDeclaration
public Location getLocation()
getLocation
in interface Java.Locatable
public void throwCompileException(java.lang.String message) throws CompileException
Java.Locatable
CompileException
with the given message and this
object's location.throwCompileException
in interface Java.Locatable
message
- The message to reportCompileException
public abstract java.lang.String toString()
toString
in class java.lang.Object