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.ConstructorDeclarators of this class.List ofJava.TypeBodyDeclarations 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 Java.AbstractTypeDeclaration
anonymousClassCount, localClassCount, resolvedType -
Constructor Summary
ConstructorsConstructorDescriptionAbstractClassDeclaration(Location location, Java.Modifier[] modifiers, Java.TypeParameter[] typeParameters) -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds oneJava.ConstructorDeclaratorto this class.voidAdds one field declaration to this class.voidAdds one field declaration or initializer to this class.voidAdds one initializer to this class.voiddefineSyntheticField(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 Java.AbstractTypeDeclaration
addDeclaredMethod, addMemberTypeDeclaration, createAnonymousClassName, createLocalTypeName, getAnnotations, getEnclosingScope, getLocation, getMemberTypeDeclaration, getMemberTypeDeclarations, getMethodDeclaration, getMethodDeclarations, getModifiers, getOptionalTypeParameters, invalidateMethodCaches, setEnclosingScope, throwCompileException, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Java.Annotatable
getAnnotationsMethods inherited from interface Java.Locatable
getLocation, throwCompileExceptionMethods inherited from interface Java.Scope
getEnclosingScopeMethods inherited from interface Java.TypeDeclaration
accept, createAnonymousClassName, createLocalTypeName, getClassName, getMemberTypeDeclaration, getMemberTypeDeclarations, getMethodDeclaration, getMethodDeclarations
-
Field Details
-
constructors
List ofJava.ConstructorDeclarators of this class. -
fieldDeclarationsAndInitializers
List ofJava.TypeBodyDeclarations 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.ConstructorDeclaratorto 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.ClassDeclarationReturns 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:
getVariableDeclaratorsAndInitializersin interfaceJava.ClassDeclaration
-
getConstructors
Java.ConstructorDeclarator[] getConstructors()- Returns:
- The declared constructors, or the default constructor
-
getSyntheticFields
- Specified by:
getSyntheticFieldsin interfaceJava.ClassDeclaration- Returns:
- The synthetic fields that were created while this type declaration was compiled
-