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

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.ContentListField
All Implemented Interfaces:
FieldOutline

public class ContentListField
extends AbstractListField

Realizes a property as an untyped List.

 List getXXX();
 

Default value handling

Since unmarshaller just adds new values into the storage, we can't fill the storage by default values at the time of instanciation. (or oherwise values found in the document will be appended to default values, where it should overwrite them.)

Therefore, when the object is created, the storage will be empty. When the getXXX method is called, we'll check if the storage is modified in anyway. If it is modified, it must mean that the values are found in the document, so we just return it. Otherwise we will fill in default values and return it to the user.

When a list has default values, its dirty flag is set to true. Marshaller will check this and treat it appropriately.


Nested Class Summary
(package private)  class ContentListField.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
protected ContentListField(ClassOutlineImpl context, CPropertyInfo prop, com.sun.codemodel.JClass coreList)
           
 
Method Summary
 ContentListField.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.
protected  com.sun.codemodel.JType getType(Aspect aspect)
          Compute the type of a CPropertyInfo
 
Methods inherited from class com.sun.tools.xjc.generator.bean.field.AbstractListField
fixNullRef, generate, getRawType
 
Methods inherited from class com.sun.tools.xjc.generator.bean.field.AbstractField
annotate, castToImplType, generateField, getOptions, getPropertyInfo, listPossibleTypes, parent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContentListField

protected ContentListField(ClassOutlineImpl context,
                           CPropertyInfo prop,
                           com.sun.codemodel.JClass coreList)
Parameters:
coreList - A concrete class that implements the List interface. An instance of this class will be used to store data for this field.
Method Detail

getCoreListType

protected final 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

generateAccessors

public void generateAccessors()
Description copied from class: AbstractListField
Generates accessor methods.

Specified by:
generateAccessors in class AbstractListField

create

public ContentListField.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.

getType

protected com.sun.codemodel.JType getType(Aspect aspect)
Description copied from class: AbstractField
Compute the type of a CPropertyInfo

Overrides:
getType in class AbstractField