Package com.sun.codemodel
Class JFieldVar
- java.lang.Object
-
- com.sun.codemodel.JExpressionImpl
-
- com.sun.codemodel.JVar
-
- com.sun.codemodel.JFieldVar
-
- All Implemented Interfaces:
JAnnotatable
,JAssignmentTarget
,JDeclaration
,JDocCommentable
,JExpression
,JGenerable
public class JFieldVar extends JVar implements JDocCommentable
A field that can have aJDocComment
associated with it
-
-
Field Summary
Fields Modifier and Type Field Description private JDocComment
jdoc
javadoc comments for this JFieldVarprivate JDefinedClass
owner
-
Constructor Summary
Constructors Constructor Description JFieldVar(JDefinedClass owner, JMods mods, JType type, java.lang.String name, JExpression init)
JFieldVar constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
declare(JFormatter f)
JDocComment
javadoc()
Creates, if necessary, and returns the class javadoc for this JDefinedClassvoid
name(java.lang.String name)
Changes the name of this variable.-
Methods inherited from class com.sun.codemodel.JVar
annotate, annotate, annotate2, annotations, assign, assignPlus, bind, generate, init, isAnnotated, mods, name, type, type
-
Methods inherited from class com.sun.codemodel.JExpressionImpl
_instanceof, band, bor, cand, complement, component, cor, decr, div, eq, gt, gte, incr, invoke, invoke, lt, lte, minus, minus, mod, mul, ne, not, plus, ref, ref, shl, shr, shrz, xor
-
-
-
-
Field Detail
-
jdoc
private JDocComment jdoc
javadoc comments for this JFieldVar
-
owner
private final JDefinedClass owner
-
-
Constructor Detail
-
JFieldVar
JFieldVar(JDefinedClass owner, JMods mods, JType type, java.lang.String name, JExpression init)
JFieldVar constructor- Parameters:
type
- Datatype of this variablename
- Name of this variableinit
- Value to initialize this variable to
-
-
Method Detail
-
name
public void name(java.lang.String name)
Description copied from class:JVar
Changes the name of this variable.
-
javadoc
public JDocComment javadoc()
Creates, if necessary, and returns the class javadoc for this JDefinedClass- Specified by:
javadoc
in interfaceJDocCommentable
- Returns:
- JDocComment containing javadocs for this class
-
declare
public void declare(JFormatter f)
- Specified by:
declare
in interfaceJDeclaration
- Overrides:
declare
in classJVar
-
-