janino.net

org.codehaus.janino
Class Java.FieldDeclaration

java.lang.Object
  extended by org.codehaus.janino.Java.Located
      extended by org.codehaus.janino.Java.Statement
          extended by org.codehaus.janino.Java.FieldDeclaration
All Implemented Interfaces:
Java.BlockStatement, Java.DocCommentable, Java.Locatable, Java.Scope, Java.TypeBodyDeclaration
Enclosing class:
Java

public static final class Java.FieldDeclaration
extends Java.Statement
implements Java.TypeBodyDeclaration, Java.DocCommentable

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
 Java.Modifiers modifiers
          The modifiers of this field declaration.
 Java.Type type
          The type of this field.
 Java.VariableDeclarator[] variableDeclarators
          The declarators of this field declaration, e.g.
 
Fields inherited from class org.codehaus.janino.Java.Statement
localVariables
 
Fields inherited from class org.codehaus.janino.Java.Located
NOWHERE
 
Constructor Summary
Java.FieldDeclaration(Location location, String optionalDocComment, Java.Modifiers modifiers, Java.Type type, Java.VariableDeclarator[] variableDeclarators)
           
 
Method Summary
 void accept(Visitor.BlockStatementVisitor visitor)
          Invokes the 'visit...()' method of Visitor.BlockStatementVisitor for the concrete Java.BlockStatement type.
 void accept(Visitor.TypeBodyDeclarationVisitor visitor)
          Invokes the 'visit...()' method of Visitor.TypeBodyDeclarationVisitor for the concrete Java.TypeBodyDeclaration type.
 Java.Annotation[] getAnnotations()
           
 Java.TypeDeclaration getDeclaringType()
           
 String getDocComment()
           
 boolean hasDeprecatedDocTag()
          Returns true if the object has a doc comment and the @deprecated tag appears in the doc comment.
 boolean isStatic()
           
 void setDeclaringType(Java.TypeDeclaration declaringType)
          Sets the type declaration that this declaration belongs to.
 String toString()
           
 
Methods inherited from class org.codehaus.janino.Java.Statement
findLocalVariable, getEnclosingScope, setEnclosingScope
 
Methods inherited from class org.codehaus.janino.Java.Located
getLocation, throwCompileException
 
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.Locatable
getLocation, throwCompileException
 
Methods inherited from interface org.codehaus.janino.Java.Scope
getEnclosingScope
 

Field Detail

modifiers

public final Java.Modifiers modifiers
The modifiers of this field declaration.


type

public final Java.Type type
The type of this field.


variableDeclarators

public final Java.VariableDeclarator[] variableDeclarators
The declarators of this field declaration, e.g. 'int a, b;'.

Constructor Detail

Java.FieldDeclaration

public Java.FieldDeclaration(Location location,
                             String optionalDocComment,
                             Java.Modifiers modifiers,
                             Java.Type type,
                             Java.VariableDeclarator[] variableDeclarators)
Method Detail

getAnnotations

public Java.Annotation[] getAnnotations()
Returns:
The annotations of this field

setDeclaringType

public void setDeclaringType(Java.TypeDeclaration declaringType)
Description copied from interface: Java.TypeBodyDeclaration
Sets the type declaration that this declaration belongs to.

Specified by:
setDeclaringType in interface Java.TypeBodyDeclaration

getDeclaringType

public Java.TypeDeclaration getDeclaringType()
Specified by:
getDeclaringType in interface Java.TypeBodyDeclaration
Returns:
The type declaration that this declaration belongs to.

isStatic

public boolean isStatic()
Specified by:
isStatic in interface Java.TypeBodyDeclaration
Returns:
Whether this declaration has the STATIC modifier

toString

public String toString()
Overrides:
toString in class Object

accept

public void accept(Visitor.TypeBodyDeclarationVisitor visitor)
Description copied from interface: Java.TypeBodyDeclaration
Invokes the 'visit...()' method of Visitor.TypeBodyDeclarationVisitor for the concrete Java.TypeBodyDeclaration type.

Specified by:
accept in interface Java.TypeBodyDeclaration

accept

public void accept(Visitor.BlockStatementVisitor visitor)
Description copied from interface: Java.BlockStatement
Invokes the 'visit...()' method of Visitor.BlockStatementVisitor for the concrete Java.BlockStatement type.

Specified by:
accept in interface Java.BlockStatement

getDocComment

public String getDocComment()
Specified by:
getDocComment in interface Java.DocCommentable
Returns:
The doc comment of the object or null

hasDeprecatedDocTag

public boolean hasDeprecatedDocTag()
Description copied from interface: Java.DocCommentable
Returns true if the object has a doc comment and the @deprecated tag appears in the doc comment.

Specified by:
hasDeprecatedDocTag in interface Java.DocCommentable

janino.net