Package org.codehaus.janino
Class Java.AbstractClassDeclaration
java.lang.Object
org.codehaus.janino.Java.AbstractTypeDeclaration
org.codehaus.janino.Java.AbstractClassDeclaration
- All Implemented Interfaces:
Java.Annotatable
,Java.ClassDeclaration
,Java.Locatable
,Java.Scope
,Java.TypeDeclaration
- Direct Known Subclasses:
Java.AnonymousClassDeclaration
,Java.EnumConstant
,Java.NamedClassDeclaration
- Enclosing class:
Java
public abstract static class Java.AbstractClassDeclaration
extends Java.AbstractTypeDeclaration
implements Java.ClassDeclaration
Base for the various class declaration kinds.
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal List
<Java.ConstructorDeclarator> List ofJava.ConstructorDeclarator
s of this class.List ofJava.TypeBodyDeclaration
s of this class: Field declarations (both static and non-static), (static and non-static) initializers (a.k.a.(package private) final SortedMap
<String, IClass.IField> All field names start with "this$" or "val$".Fields inherited from class org.codehaus.janino.Java.AbstractTypeDeclaration
anonymousClassCount, localClassCount, resolvedType
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractClassDeclaration
(Location location, Java.Modifier[] modifiers, Java.TypeParameter[] typeParameters) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds oneJava.ConstructorDeclarator
to this class.void
Adds one field declaration to this class.void
Adds one field declaration or initializer to this class.void
Adds one initializer to this class.void
defineSyntheticField
(IClass.IField iField) (package private) Java.ConstructorDeclarator[]
Returns the initializers for class variables (JLS7 8.3.2.1) and instance variables (JLS7 8.3.2.2), and the instance initializers (JLS7 8.6) and static initializers (JLS7 8.7) in the order as they appear in the type declaration.Methods inherited from class org.codehaus.janino.Java.AbstractTypeDeclaration
addDeclaredMethod, addMemberTypeDeclaration, createAnonymousClassName, createLocalTypeName, getAnnotations, getEnclosingScope, getLocation, getMemberTypeDeclaration, getMemberTypeDeclarations, getMethodDeclaration, getMethodDeclarations, getModifiers, getOptionalTypeParameters, invalidateMethodCaches, setEnclosingScope, throwCompileException, 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.Annotatable
getAnnotations
Methods inherited from interface org.codehaus.janino.Java.Locatable
getLocation, throwCompileException
Methods inherited from interface org.codehaus.janino.Java.Scope
getEnclosingScope
Methods inherited from interface org.codehaus.janino.Java.TypeDeclaration
accept, createAnonymousClassName, createLocalTypeName, getClassName, getMemberTypeDeclaration, getMemberTypeDeclarations, getMethodDeclaration, getMethodDeclarations
-
Field Details
-
constructors
List ofJava.ConstructorDeclarator
s of this class. -
fieldDeclarationsAndInitializers
List ofJava.TypeBodyDeclaration
s of this class: Field declarations (both static and non-static), (static and non-static) initializers (a.k.a. "class initializers" and "instance initializers"). -
syntheticFields
All field names start with "this$" or "val$".
-
-
Constructor Details
-
AbstractClassDeclaration
public AbstractClassDeclaration(Location location, Java.Modifier[] modifiers, @Nullable Java.TypeParameter[] typeParameters)
-
-
Method Details
-
addConstructor
Adds oneJava.ConstructorDeclarator
to this class. -
addFieldDeclaration
Adds one field declaration to this class. -
addInitializer
Adds one initializer to this class. -
addFieldDeclarationOrInitializer
Adds one field declaration or initializer to this class. -
defineSyntheticField
- Throws:
CompileException
- See Also:
-
getVariableDeclaratorsAndInitializers
Description copied from interface:Java.ClassDeclaration
Returns the initializers for class variables (JLS7 8.3.2.1) and instance variables (JLS7 8.3.2.2), and the instance initializers (JLS7 8.6) and static initializers (JLS7 8.7) in the order as they appear in the type declaration.- Specified by:
getVariableDeclaratorsAndInitializers
in interfaceJava.ClassDeclaration
-
getConstructors
Java.ConstructorDeclarator[] getConstructors()- Returns:
- The declared constructors, or the default constructor
-
getSyntheticFields
- Specified by:
getSyntheticFields
in interfaceJava.ClassDeclaration
- Returns:
- The synthetic fields that were created while this type declaration was compiled
-