T' field;
T getXXX() { ... }
void setXXX(T value) { ... }
Normally T'=T, but under some tricky circumstances they could be different (like T'=Integer, T=int.) This realization is only applicable to fields with (1,1) or (0,1) multiplicity.
| Modifier and Type | Class and Description |
|---|---|
| protected class |
| Access | Constructor and Description |
|---|---|
| protected | |
| protected | SingleField(ClassOutlineImpl context, CPropertyInfo prop, boolean
forces the setter/getter to expose the primitive type.
it's a pointless customization, but it's nevertheless in the spec. forcePrimitiveAccess)
|
| Modifier and Type | Method and Description |
|---|---|
| public FieldAccessor | create(JExpression targetObject)
Implements com. Creates a new |
| public final JType | getFieldType()
Implements abstract com. Returns the type used to store the value of the field in memory. |
| SingleField | back to summary |
|---|---|
| protected SingleField(ClassOutlineImpl context, CPropertyInfo prop) | |
| SingleField | back to summary |
|---|---|
protected SingleField(ClassOutlineImpl context, CPropertyInfo prop, boolean forcePrimitiveAccess)
| |
| create | back to summary |
|---|---|
| public FieldAccessor create(JExpression targetObject) Implements com. Doc from com. Creates a new
| |
| getFieldType | back to summary |
|---|---|
| public final JType getFieldType() Implements abstract com. Doc from com. Returns the type used to store the value of the field in memory.
| |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public JExpression | hasSetValue()
Implements com. Return an expression that evaluates to true only when this field has a set value(s). |
| public void | unsetValues(JBlock body)
Implements com. Generates a code fragment to remove any "set" value and move this field to the "unset" state. |
| Accessor | back to summary |
|---|---|
| protected Accessor(JExpression $target) | |
| hasSetValue | back to summary |
|---|---|
| public JExpression hasSetValue() Implements com. Doc from com. Return an expression that evaluates to true only when this field has a set value(s).
| |
| unsetValues | back to summary |
|---|---|
| public void unsetValues(JBlock body) Implements com. Doc from com. Generates a code fragment to remove any "set" value and move this field to the "unset" state.
| |