com.sun.codemodel
public class JVar extends JExpressionImpl implements JDeclaration, JAssignmentTarget, JAnnotatable
Modifier and Type | Method and Description |
---|---|
JAnnotationUse |
annotate(java.lang.Class<? extends java.lang.annotation.Annotation> clazz)
Adds an annotation to this variable.
|
JAnnotationUse |
annotate(JClass clazz)
Adds an annotation to this variable.
|
<W extends JAnnotationWriter> |
annotate2(java.lang.Class<W> clazz)
Adds an annotation to this program element
and returns a type-safe writer to fill in the values of such annotations.
|
JExpression |
assign(JExpression rhs) |
JExpression |
assignPlus(JExpression rhs) |
void |
bind(JFormatter f) |
void |
declare(JFormatter f) |
void |
generate(JFormatter f) |
JVar |
init(JExpression init)
Initialize this variable
|
protected boolean |
isAnnotated() |
JMods |
mods() |
java.lang.String |
name()
Get the name of this variable
|
void |
name(java.lang.String name)
Changes the name of this variable.
|
JType |
type()
Return the type of this variable.
|
JType |
type(JType newType)
Sets the type of this variable.
|
_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
public JVar init(JExpression init)
init
- JExpression to be used to initialize this fieldpublic java.lang.String name()
public void name(java.lang.String name)
public JType type()
public JMods mods()
public JType type(JType newType)
newType
- must not be null.public JAnnotationUse annotate(JClass clazz)
annotate
in interface JAnnotatable
clazz
- The annotation class to annotate the field withpublic JAnnotationUse annotate(java.lang.Class<? extends java.lang.annotation.Annotation> clazz)
annotate
in interface JAnnotatable
clazz
- The annotation class to annotate the field withpublic <W extends JAnnotationWriter> W annotate2(java.lang.Class<W> clazz)
JAnnotatable
annotate2
in interface JAnnotatable
protected boolean isAnnotated()
public void bind(JFormatter f)
public void declare(JFormatter f)
declare
in interface JDeclaration
public void generate(JFormatter f)
public JExpression assign(JExpression rhs)
assign
in interface JAssignmentTarget
public JExpression assignPlus(JExpression rhs)
assignPlus
in interface JAssignmentTarget
Copyright © 2005-2014 Sun Microsystems. All Rights Reserved.