com.sun.tools.xjc.generator.bean.field
Class SingleField.Accessor
java.lang.Object
com.sun.tools.xjc.generator.bean.field.AbstractField.Accessor
com.sun.tools.xjc.generator.bean.field.AbstractFieldWithVar.Accessor
com.sun.tools.xjc.generator.bean.field.SingleField.Accessor
- All Implemented Interfaces:
- FieldAccessor
- Enclosing class:
- SingleField
protected class SingleField.Accessor
- extends AbstractFieldWithVar.Accessor
Method Summary |
void |
add(com.sun.codemodel.JBlock block,
com.sun.codemodel.JExpression newValue)
Generate a code to add the "newValue" to this field
and set it to the 'body'. |
com.sun.codemodel.JExpression |
getContentValue()
Get the "content" of this field in one object. |
com.sun.codemodel.JExpression |
hasSetValue()
Return an expression that evaluates to true only when
this field has a set value(s). |
void |
toArray(com.sun.codemodel.JBlock block,
com.sun.codemodel.JExpression $array)
Dumps everything in this field into the given array,
which is guaranteed to have the enough space to store
all the values (that is, the caller is responsible
for ensuring the size of the array.)
The type of the array must be the same
as getPropertyInfo().getType() . |
void |
unsetValues(com.sun.codemodel.JBlock body)
Generates a code fragment to remove any "set" value
and move this field to the "unset" state. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SingleField.Accessor
protected SingleField.Accessor(com.sun.codemodel.JExpression $target)
add
public void add(com.sun.codemodel.JBlock block,
com.sun.codemodel.JExpression newValue)
- Description copied from interface:
FieldAccessor
- Generate a code to add the "newValue" to this field
and set it to the 'body'.
toArray
public void toArray(com.sun.codemodel.JBlock block,
com.sun.codemodel.JExpression $array)
- Description copied from interface:
FieldAccessor
- Dumps everything in this field into the given array,
which is guaranteed to have the enough space to store
all the values (that is, the caller is responsible
for ensuring the size of the array.)
The type of the array must be the same
as
getPropertyInfo().getType()
.
unsetValues
public void unsetValues(com.sun.codemodel.JBlock body)
- Description copied from interface:
FieldAccessor
- Generates a code fragment to remove any "set" value
and move this field to the "unset" state.
- Parameters:
body
- The code will be appended at the end of this block.
hasSetValue
public com.sun.codemodel.JExpression hasSetValue()
- Description copied from interface:
FieldAccessor
- Return an expression that evaluates to true only when
this field has a set value(s).
- Returns:
- null
if the isSetXXX/unsetXXX method does not make sense
for the given field.
getContentValue
public com.sun.codemodel.JExpression getContentValue()
- Description copied from interface:
FieldAccessor
- Get the "content" of this field in one object.
The type of this expression is the type returned by the
getValueType method.
The notion of "content" is defined in the spec.
Typically, it is a single Object
that represents
the field. For fields with a primitive value, this is a boxed
type. For a list field, this is a List
.
This object will be returned from the getContent method
of the choice content interface.