com.sun.tools.xjc.generator.bean.field
Class ArrayField

java.lang.Object
  extended by com.sun.tools.xjc.generator.bean.field.AbstractField
      extended by com.sun.tools.xjc.generator.bean.field.AbstractListField
          extended by 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.


Nested Class Summary
(package private)  class ArrayField.Accessor
           
 
Field Summary
 
Fields inherited from class com.sun.tools.xjc.generator.bean.field.AbstractListField
field, listT, primitiveType
 
Fields inherited from class com.sun.tools.xjc.generator.bean.field.AbstractField
codeModel, exposedType, implType, outline, prop
 
Constructor Summary
ArrayField(ClassOutlineImpl context, CPropertyInfo prop)
           
 
Method Summary
 ArrayField.Accessor create(com.sun.codemodel.JExpression targetObject)
          Creates a new FieldAccessor of this field for the specified object.
 void generateAccessors()
          Generates accessor methods.
protected  com.sun.codemodel.JClass getCoreListType()
          Concrete class that implements the List interface.
 com.sun.codemodel.JType getRawType()
          Gets the type of the "raw value".
 
Methods inherited from class com.sun.tools.xjc.generator.bean.field.AbstractListField
fixNullRef, generate
 
Methods inherited from class com.sun.tools.xjc.generator.bean.field.AbstractField
annotate, castToImplType, generateField, getOptions, getPropertyInfo, getType, listPossibleTypes, parent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArrayField

ArrayField(ClassOutlineImpl context,
           CPropertyInfo prop)
Method Detail

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.