public interface ModifiableFieldReference extends FieldInfo
Modifier and Type | Interface and Description |
---|---|
static class |
ModifiableFieldReference.ReferenceType |
Modifier and Type | Method and Description |
---|---|
void |
complete()
Mark the end of the code generation to replace the field
reference.
|
FieldInfo |
field() |
ModifiableFieldReference.ReferenceType |
getReferenceType() |
Variable |
getTargetObject()
Return an expression that can be used to access
the target object, if !Modifier.isStatic(field().modifiers()).
|
Variable |
getValue()
Return an expression that can be used to access
the field value.
|
MethodInfo |
method() |
void |
replace()
After this call, the field reference will not be emitted.
|
isAccessibleInContext, modifiers, myClassInfo, name
MethodInfo method()
FieldInfo field()
ModifiableFieldReference.ReferenceType getReferenceType()
Variable getTargetObject()
Variable getValue()
void replace()
Variable target = mf.getTargetObject() ; Variable value = mf.getValue() ; String name = field().name() ; // For getReferenceType() == GET: _assign( value, _field( target, name ) ) ; // For getRerenceType() == SET: _assign( _field( target, name ), value ) ;
void complete()
Copyright © 2017 Oracle. All rights reserved.