public class JVar extends JExpressionImpl implements JDeclaration, JAssignmentTarget, JAnnotatable
| Modifier and Type | Method and Description |
|---|---|
JAnnotationUse |
annotate(Class<? extends Annotation> clazz)
Adds an annotation to this variable.
|
JAnnotationUse |
annotate(JClass clazz)
Adds an annotation to this variable.
|
<W extends JAnnotationWriter> |
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.
|
boolean |
removeAnnotation(JAnnotationUse annotation)
Removes annotation from this program element.
|
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, xorpublic 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 JAnnotatableclazz - The annotation class to annotate the field withpublic JAnnotationUse annotate(Class<? extends Annotation> clazz)
annotate in interface JAnnotatableclazz - The annotation class to annotate the field withpublic <W extends JAnnotationWriter> W annotate2(Class<W> clazz)
JAnnotatableannotate2 in interface JAnnotatablepublic boolean removeAnnotation(JAnnotationUse annotation)
JAnnotatableremoveAnnotation in interface JAnnotatableannotation - The annotation to be removed from the program elementpublic Collection<JAnnotationUse> annotations()
JAnnotatableJAnnotatableannotations in interface JAnnotatableprotected boolean isAnnotated()
public void bind(JFormatter f)
public void declare(JFormatter f)
declare in interface JDeclarationpublic void generate(JFormatter f)
generate in interface JGenerablepublic JExpression assign(JExpression rhs)
assign in interface JAssignmentTargetpublic JExpression assignPlus(JExpression rhs)
assignPlus in interface JAssignmentTargetCopyright © 2017 JBoss by Red Hat. All rights reserved.