Package com.sun.codemodel
Class JFieldRef
- java.lang.Object
-
- com.sun.codemodel.JExpressionImpl
-
- com.sun.codemodel.JFieldRef
-
- All Implemented Interfaces:
JAssignmentTarget
,JExpression
,JGenerable
public class JFieldRef extends JExpressionImpl implements JAssignmentTarget
Field Reference
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
explicitThis
Indicates if an explicit this should be generatedprivate java.lang.String
name
Name of the field to be accessed.private JGenerable
object
Object expression upon which this field will be accessed, or null for the implicit 'this'.private JVar
var
Variable to be accessed.
-
Constructor Summary
Constructors Constructor Description JFieldRef(JExpression object, JVar v)
JFieldRef(JExpression object, java.lang.String name)
Field reference constructor given an object expression and field nameJFieldRef(JGenerable object, JVar var, boolean explicitThis)
JFieldRef(JGenerable object, java.lang.String name, boolean explicitThis)
JFieldRef(JType type, JVar v)
JFieldRef(JType type, java.lang.String name)
Static field reference.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JExpression
assign(JExpression rhs)
JExpression
assignPlus(JExpression rhs)
void
generate(JFormatter f)
-
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
-
object
private JGenerable object
Object expression upon which this field will be accessed, or null for the implicit 'this'.
-
name
private java.lang.String name
Name of the field to be accessed. Either this orvar
is set.
-
var
private JVar var
Variable to be accessed.
-
explicitThis
private boolean explicitThis
Indicates if an explicit this should be generated
-
-
Constructor Detail
-
JFieldRef
JFieldRef(JExpression object, java.lang.String name)
Field reference constructor given an object expression and field name- Parameters:
object
- JExpression for the object upon which the named field will be accessed,name
- Name of field to access
-
JFieldRef
JFieldRef(JExpression object, JVar v)
-
JFieldRef
JFieldRef(JType type, java.lang.String name)
Static field reference.
-
JFieldRef
JFieldRef(JGenerable object, java.lang.String name, boolean explicitThis)
-
JFieldRef
JFieldRef(JGenerable object, JVar var, boolean explicitThis)
-
-
Method Detail
-
generate
public void generate(JFormatter f)
- Specified by:
generate
in interfaceJGenerable
-
assign
public JExpression assign(JExpression rhs)
- Specified by:
assign
in interfaceJAssignmentTarget
-
assignPlus
public JExpression assignPlus(JExpression rhs)
- Specified by:
assignPlus
in interfaceJAssignmentTarget
-
-