Class Java.FieldDeclaration
java.lang.Object
org.codehaus.janino.Java.Located
org.codehaus.janino.Java.Statement
org.codehaus.janino.Java.FieldDeclaration
- All Implemented Interfaces:
Java.Annotatable, Java.BlockStatement, Java.DocCommentable, Java.FieldDeclarationOrInitializer, Java.Locatable, Java.Scope, Java.TypeBodyDeclaration
- Enclosing class:
Java
public static final class Java.FieldDeclaration
extends Java.Statement
implements Java.Annotatable, Java.DocCommentable, Java.FieldDeclarationOrInitializer
This class is derived from "Statement", because it provides for the initialization of the field. In other words,
"compile()" generates the code that initializes the field.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Stringfinal Java.Modifier[]The modifiers of this field declaration.final Java.TypeThe type of this field.final Java.VariableDeclarator[]The declarators of this field declaration, e.g.Fields inherited from class Java.Statement
localVariablesFields inherited from class Java.Located
NOWHERE -
Constructor Summary
ConstructorsConstructorDescriptionFieldDeclaration(Location location, String docComment, Java.Modifier[] modifiers, Java.Type type, Java.VariableDeclarator[] variableDeclarators) -
Method Summary
Modifier and TypeMethodDescription<R, EX extends Throwable>
Raccept(Visitor.BlockStatementVisitor<R, EX> visitor) Invokes the "visit...()" method ofVisitor.BlockStatementVisitorfor the concreteJava.BlockStatementtype.<R, EX extends Throwable>
Raccept(Visitor.FieldDeclarationOrInitializerVisitor<R, EX> visitor) <R, EX extends Throwable>
Raccept(Visitor.TypeBodyDeclarationVisitor<R, EX> visitor) Invokes the "visit...()" method ofVisitor.TypeBodyDeclarationVisitorfor the concreteJava.TypeBodyDeclarationtype.booleanReturnstrueif the object has a doc comment and the@deprecatedtag appears in the doc comment.booleanisFinal()booleanbooleanisStatic()booleanbooleanvoidsetDeclaringType(Java.TypeDeclaration declaringType) Sets the type declaration that this declaration belongs to.voidsetEnclosingScope(Java.Scope enclosingScope) Sets the enclosing scope of thisJava.BlockStatement.toString()Methods inherited from class Java.Statement
findLocalVariable, getEnclosingScopeMethods inherited from class Java.Located
getLocation, throwCompileExceptionMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Java.BlockStatement
findLocalVariable, getEnclosingScopeMethods inherited from interface Java.Locatable
getLocation, throwCompileException
-
Field Details
-
docComment
-
modifiers
The modifiers of this field declaration. -
type
The type of this field. -
variableDeclarators
The declarators of this field declaration, e.g. "int a, b;".
-
-
Constructor Details
-
FieldDeclaration
public FieldDeclaration(Location location, @Nullable String docComment, Java.Modifier[] modifiers, Java.Type type, Java.VariableDeclarator[] variableDeclarators)
-
-
Method Details
-
setDeclaringType
Description copied from interface:Java.TypeBodyDeclarationSets the type declaration that this declaration belongs to.- Specified by:
setDeclaringTypein interfaceJava.TypeBodyDeclaration
-
getDeclaringType
- Specified by:
getDeclaringTypein interfaceJava.TypeBodyDeclaration- Returns:
- The type declaration that this declaration belongs to.
-
setEnclosingScope
Description copied from interface:Java.BlockStatementSets the enclosing scope of thisJava.BlockStatement.- Specified by:
setEnclosingScopein interfaceJava.BlockStatement- Overrides:
setEnclosingScopein classJava.Statement
-
getModifiers
- Specified by:
getModifiersin interfaceJava.TypeBodyDeclaration- Returns:
- The
Java.Modifiers of this declaration
-
toString
-
accept
@Nullable public <R, EX extends Throwable> R accept(Visitor.FieldDeclarationOrInitializerVisitor<R, EX> visitor) throws EX- Specified by:
acceptin interfaceJava.FieldDeclarationOrInitializer- Throws:
EX
-
accept
@Nullable public <R, EX extends Throwable> R accept(Visitor.TypeBodyDeclarationVisitor<R, EX> visitor) throws EXDescription copied from interface:Java.TypeBodyDeclarationInvokes the "visit...()" method ofVisitor.TypeBodyDeclarationVisitorfor the concreteJava.TypeBodyDeclarationtype.- Specified by:
acceptin interfaceJava.TypeBodyDeclaration- Throws:
EX
-
accept
@Nullable public <R, EX extends Throwable> R accept(Visitor.BlockStatementVisitor<R, EX> visitor) throws EXDescription copied from interface:Java.BlockStatementInvokes the "visit...()" method ofVisitor.BlockStatementVisitorfor the concreteJava.BlockStatementtype.- Specified by:
acceptin interfaceJava.BlockStatement- Throws:
EX
-
getDocComment
- Specified by:
getDocCommentin interfaceJava.DocCommentable- Returns:
- The doc comment of the object or
null
-
hasDeprecatedDocTag
public boolean hasDeprecatedDocTag()Description copied from interface:Java.DocCommentableReturnstrueif the object has a doc comment and the@deprecatedtag appears in the doc comment.- Specified by:
hasDeprecatedDocTagin interfaceJava.DocCommentable
-
getAccess
-
getAnnotations
- Specified by:
getAnnotationsin interfaceJava.Annotatable- Returns:
- The annotations of this
Java.TypeDeclaration,Java.FieldDeclaration,Java.MethodDeclaratororJava.ConstructorDeclarator
-
isFinal
public boolean isFinal() -
isPrivate
public boolean isPrivate() -
isStatic
public boolean isStatic() -
isTransient
public boolean isTransient() -
isVolatile
public boolean isVolatile()
-