org.codehaus.janino
Class Java.AbstractTypeDeclaration

java.lang.Object
  extended by 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
 int anonymousClassCount
           
 int localClassCount
           
 
Constructor Summary
Java.AbstractTypeDeclaration(Location location, short modifiers)
           
 
Method Summary
 void addDeclaredMethod(Java.MethodDeclarator method)
           
 void addMemberTypeDeclaration(Java.MemberTypeDeclaration mcoid)
           
 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.Scope getEnclosingScope()
           
 Location getLocation()
           
 Java.MemberTypeDeclaration getMemberTypeDeclaration(java.lang.String name)
          Return the member type with the given name.
 java.util.Collection getMemberTypeDeclarations()
           
 Java.MethodDeclarator getMethodDeclaration(java.lang.String name)
          Return the first method declared with the given name.
 java.util.List getMethodDeclarations()
           
 short getModifiers()
           
 void invalidateMethodCaches()
           
 void setEnclosingScope(Java.Scope enclosingScope)
           
 void throwCompileException(java.lang.String message)
          Throw a CompileException with the given message and this object's location.
abstract  java.lang.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 Detail

anonymousClassCount

public int anonymousClassCount

localClassCount

public int localClassCount
Constructor Detail

Java.AbstractTypeDeclaration

public Java.AbstractTypeDeclaration(Location location,
                                    short modifiers)
Method Detail

getModifiers

public short getModifiers()
Specified by:
getModifiers in interface Java.TypeDeclaration

setEnclosingScope

public void setEnclosingScope(Java.Scope enclosingScope)

getEnclosingScope

public Java.Scope getEnclosingScope()
Specified by:
getEnclosingScope in interface Java.Scope

invalidateMethodCaches

public void invalidateMethodCaches()

addMemberTypeDeclaration

public void addMemberTypeDeclaration(Java.MemberTypeDeclaration mcoid)

getMemberTypeDeclarations

public java.util.Collection getMemberTypeDeclarations()
Specified by:
getMemberTypeDeclarations in interface Java.TypeDeclaration

getMemberTypeDeclaration

public Java.MemberTypeDeclaration getMemberTypeDeclaration(java.lang.String name)
Description copied from interface: Java.TypeDeclaration
Return the member type with the given name.

Specified by:
getMemberTypeDeclaration in interface Java.TypeDeclaration
Returns:
null if 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.TypeDeclaration
Return the first method declared with the given name. (Does not honor inherited methods.)

Specified by:
getMethodDeclaration in interface Java.TypeDeclaration
Returns:
null if a method with this name is not declared

getMethodDeclarations

public java.util.List getMethodDeclarations()
Specified by:
getMethodDeclarations in interface Java.TypeDeclaration

createLocalTypeName

public java.lang.String createLocalTypeName(java.lang.String localTypeName)
Description copied from interface: Java.TypeDeclaration
Creates a unique name for a local class or interface.

Specified by:
createLocalTypeName in interface Java.TypeDeclaration

createAnonymousClassName

public java.lang.String createAnonymousClassName()
Description copied from interface: Java.TypeDeclaration
Creates a unique name for an anonymous class.

Specified by:
createAnonymousClassName in interface Java.TypeDeclaration

getLocation

public Location getLocation()
Specified by:
getLocation in interface Java.Locatable

throwCompileException

public void throwCompileException(java.lang.String message)
                           throws CompileException
Description copied from interface: Java.Locatable
Throw a CompileException with the given message and this object's location.

Specified by:
throwCompileException in interface Java.Locatable
Parameters:
message - The message to report
Throws:
CompileException

toString

public abstract java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2001-2012. All Rights Reserved.