com.sun.tools.xjc.generator.bean.field
Class ArrayField
java.lang.Object
com.sun.tools.xjc.generator.bean.field.AbstractField
com.sun.tools.xjc.generator.bean.field.AbstractListField
com.sun.tools.xjc.generator.bean.field.ArrayField
- All Implemented Interfaces:
- FieldOutline
final class ArrayField
- extends AbstractListField
Realizes a property as an "indexed property"
as specified in the JAXB spec.
We will generate the following set of methods:
T[] getX();
T getX( int idx );
void setX(T[] values);
void setX( int idx, T value );
We still use List as our back storage.
This renderer also handles boxing/unboxing if
T is a boxed type.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ArrayField
ArrayField(ClassOutlineImpl context,
CPropertyInfo prop)
generateAccessors
public void generateAccessors()
- Description copied from class:
AbstractListField
- Generates accessor methods.
- Specified by:
generateAccessors
in class AbstractListField
getRawType
public com.sun.codemodel.JType getRawType()
- Description copied from interface:
FieldOutline
- Gets the type of the "raw value".
This type can represent the entire value of this field.
For fields that can carry multiple values, this is an array.
This type allows the client of the outline to generate code
to set/get values from a property.
- Specified by:
getRawType
in interface FieldOutline
- Overrides:
getRawType
in class AbstractListField
getCoreListType
protected com.sun.codemodel.JClass getCoreListType()
- Description copied from class:
AbstractListField
- Concrete class that implements the List interface.
Used as the actual data storage.
- Specified by:
getCoreListType
in class AbstractListField
create
public ArrayField.Accessor 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.