net.janino
Class Java.ClassOrInterfaceDeclaration

java.lang.Object
  |
  +--net.janino.IClass
        |
        +--net.janino.Java.ClassOrInterfaceDeclaration
All Implemented Interfaces:
Java.Locatable, Java.Scope
Direct Known Subclasses:
Java.ClassDeclaration, Java.InterfaceDeclaration
Enclosing class:
Java

public abstract static class Java.ClassOrInterfaceDeclaration
extends IClass
implements Java.Locatable, Java.Scope


Inner classes inherited from class net.janino.IClass
IClass.IConstructor, IClass.IField, IClass.IInvocable, IClass.IMember, IClass.IMethod
 
Field Summary
protected  java.util.List declaredClassesAndInterfaces
           
protected  java.util.List declaredMethods
           
protected  short modifiers
          {@see Mod}
protected  java.lang.String name
          Declared, not fully qualified name.
 
Fields inherited from class net.janino.IClass
PACKAGE, PRIVATE, PROTECTED, PUBLIC
 
Constructor Summary
Java.ClassOrInterfaceDeclaration(Scanner.Location location, Java.Scope enclosingScope, short modifiers, java.lang.String name)
           
 
Method Summary
 void addDeclaredMethod(Java.MethodDeclarator method)
           
abstract  void compile(int debuggingInformation)
          Compile yourself.
 void compileError(java.lang.String message)
           
protected  java.lang.String getClassName()
          Determine the fully qualified name of this class or interface.
 IClass getComponentType()
          Returns the component type of the array.
Returns "null" for classes, interfaces, primitive types and "void".
 IClass[] getDeclaredIClasses()
          Returns the classes and interfaces declared as members of the class (but not inherited classes and interfaces).
Returns an empty array for an array, primitive type or "void".
 IClass.IMethod[] getDeclaredIMethods()
          Returns the methods of the class or interface (but not inherited methods).
Returns an empty array for an array, primitive type or "void".
 java.lang.String getDescriptor()
          Returns the field descriptor for the type as defined by JVMS 4.3.2.
 Java.Scope getEnclosingScope()
           
 Scanner.Location getLocation()
           
 boolean isArray()
          Returns "true" if this type represents an array.
 boolean isPrimitive()
          Returns "true" if this type represents a primitive type or "void".
 boolean isPrimitiveNumeric()
          Returns "true" if this type represents "byte", "short", "int", "long", "char", "float" or "double".
 void throwParseException(java.lang.String message)
           
 java.lang.String toString()
           
 
Methods inherited from class net.janino.IClass
createArrayIClass, getDeclaredIConstructors, getDeclaredIFields, getInterfaces, getSuperclass, implementsInterface, isAbstract, isAssignableFrom, isFinal, isInterface, isPublic, isSubclassOf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

modifiers

protected short modifiers
{@see Mod}

name

protected java.lang.String name
Declared, not fully qualified name.

declaredMethods

protected final java.util.List declaredMethods

declaredClassesAndInterfaces

protected final java.util.List declaredClassesAndInterfaces
Constructor Detail

Java.ClassOrInterfaceDeclaration

public Java.ClassOrInterfaceDeclaration(Scanner.Location location,
                                        Java.Scope enclosingScope,
                                        short modifiers,
                                        java.lang.String name)
                                 throws Parser.ParseException
Method Detail

addDeclaredMethod

public void addDeclaredMethod(Java.MethodDeclarator method)

getEnclosingScope

public Java.Scope getEnclosingScope()
Specified by:
getEnclosingScope in interface Java.Scope
Following copied from interface: net.janino.Java.Scope
Returns:
Enclusing scope or "null".

getClassName

protected java.lang.String getClassName()
Determine the fully qualified name of this class or interface.
Returns:
E.g. "pkg1.pkg2.Outer$Inner"

getLocation

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

throwParseException

public void throwParseException(java.lang.String message)
                         throws Parser.ParseException
Specified by:
throwParseException in interface Java.Locatable

compileError

public void compileError(java.lang.String message)
                  throws Java.CompileException
Specified by:
compileError in interface Java.Locatable

getDeclaredIMethods

public IClass.IMethod[] getDeclaredIMethods()
Description copied from class: IClass
Returns the methods of the class or interface (but not inherited methods).
Returns an empty array for an array, primitive type or "void".
Overrides:
getDeclaredIMethods in class IClass

getDeclaredIClasses

public IClass[] getDeclaredIClasses()
Description copied from class: IClass
Returns the classes and interfaces declared as members of the class (but not inherited classes and interfaces).
Returns an empty array for an array, primitive type or "void".
Overrides:
getDeclaredIClasses in class IClass

getDescriptor

public java.lang.String getDescriptor()
Description copied from class: IClass
Returns the field descriptor for the type as defined by JVMS 4.3.2.
Overrides:
getDescriptor in class IClass

isArray

public boolean isArray()
Description copied from class: IClass
Returns "true" if this type represents an array.
Overrides:
isArray in class IClass

getComponentType

public IClass getComponentType()
Description copied from class: IClass
Returns the component type of the array.
Returns "null" for classes, interfaces, primitive types and "void".
Overrides:
getComponentType in class IClass

isPrimitive

public boolean isPrimitive()
Description copied from class: IClass
Returns "true" if this type represents a primitive type or "void".
Overrides:
isPrimitive in class IClass

isPrimitiveNumeric

public boolean isPrimitiveNumeric()
Description copied from class: IClass
Returns "true" if this type represents "byte", "short", "int", "long", "char", "float" or "double".
Overrides:
isPrimitiveNumeric in class IClass

toString

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

compile

public abstract void compile(int debuggingInformation)
                      throws Java.CompileException
Compile yourself. Results are stored in Java.generatedClassFiles.
Throws:
CompileException -