com.sun.tools.xjc.generator.bean.field
Class SingleField
java.lang.Object
com.sun.tools.xjc.generator.bean.field.AbstractField
com.sun.tools.xjc.generator.bean.field.AbstractFieldWithVar
com.sun.tools.xjc.generator.bean.field.SingleField
- All Implemented Interfaces:
- FieldOutline
- Direct Known Subclasses:
- SinglePrimitiveAccessField
public class SingleField
- extends AbstractFieldWithVar
Realizes a property through one getter and one setter.
This renders:
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.
Method Summary |
FieldAccessor |
create(com.sun.codemodel.JExpression targetObject)
Creates a new FieldAccessor of this field
for the specified object. |
com.sun.codemodel.JType |
getFieldType()
Returns the type used to store the value of the field in memory. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SingleField
protected SingleField(ClassOutlineImpl context,
CPropertyInfo prop)
SingleField
protected SingleField(ClassOutlineImpl context,
CPropertyInfo prop,
boolean forcePrimitiveAccess)
- Parameters:
forcePrimitiveAccess
- forces the setter/getter to expose the primitive type.
it's a pointless customization, but it's nevertheless in the spec.
getFieldType
public final com.sun.codemodel.JType getFieldType()
- Description copied from class:
AbstractFieldWithVar
- Returns the type used to store the value of the field in memory.
- Specified by:
getFieldType
in class AbstractFieldWithVar
create
public FieldAccessor create(com.sun.codemodel.JExpression targetObject)
- Description copied from interface:
FieldOutline
- Creates a new
FieldAccessor
of this field
for the specified object.
- Parameters:
targetObject
- Evaluates to an object, and the field on this object
will be accessed.