|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.codemodel.JExpressionImpl
com.sun.codemodel.JVar
public class JVar
Variables and fields.
Method Summary | ||
---|---|---|
JAnnotationUse |
annotate(Class<? extends Annotation> clazz)
Adds an annotation to this variable. |
|
JAnnotationUse |
annotate(JClass clazz)
Adds an annotation to this variable. |
|
|
annotate2(Class<W> clazz)
Adds an annotation to this program element and returns a type-safe writer to fill in the values of such annotations. |
|
Collection<JAnnotationUse> |
annotations()
Read-only live view of all annotations on this JAnnotatable |
|
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()
|
|
String |
name()
Get the name of this variable |
|
void |
name(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. |
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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.sun.codemodel.JExpression |
---|
_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 |
Method Detail |
---|
public JVar init(JExpression init)
init
- JExpression to be used to initialize this fieldpublic String name()
public void name(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(Class<? extends Annotation> clazz)
annotate
in interface JAnnotatable
clazz
- The annotation class to annotate the field withpublic <W extends JAnnotationWriter> W annotate2(Class<W> clazz)
JAnnotatable
annotate2
in interface JAnnotatable
public Collection<JAnnotationUse> annotations()
JAnnotatable
JAnnotatable
annotations
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)
generate
in interface JGenerable
public JExpression assign(JExpression rhs)
assign
in interface JAssignmentTarget
public JExpression assignPlus(JExpression rhs)
assignPlus
in interface JAssignmentTarget
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |