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

Class AbstractListField

abstract class AbstractListField extends AbstractField

Common code for property renderer that generates a List as its underlying data structure.

For performance reasons, the actual list object used to store data is lazily created.

Nested Class Summary
protected abstract classAbstractListField.Accessor
Field Summary
protected JFieldVarfield
The field that stores the list.
protected JClasslistT
protected JPrimitiveTypeprimitiveType
If this collection property is a collection of a primitive type, this variable refers to that primitive type.
Constructor Summary
protected AbstractListField(ClassOutlineImpl outline, CPropertyInfo prop, boolean eagerInstanciation)
Call generate method right after this.
Method Summary
protected voidfixNullRef(JBlock block)
Generates statement(s) so that the successive Accessor with true will always return a non-null list.
protected voidgenerate()
protected abstract voidgenerateAccessors()
Generates accessor methods.
protected abstract JClassgetCoreListType()
Concrete class that implements the List interface.
JTypegetRawType()

Field Detail

field

protected JFieldVar field
The field that stores the list.

listT

protected final JClass listT

primitiveType

protected final JPrimitiveType primitiveType
If this collection property is a collection of a primitive type, this variable refers to that primitive type. Otherwise null.

Constructor Detail

AbstractListField

protected AbstractListField(ClassOutlineImpl outline, CPropertyInfo prop, boolean eagerInstanciation)
Call generate method right after this.

Method Detail

fixNullRef

protected final void fixNullRef(JBlock block)
Generates statement(s) so that the successive Accessor with true will always return a non-null list. This is useful to avoid generating redundant internal getter.

generate

protected final void generate()

generateAccessors

protected abstract void generateAccessors()
Generates accessor methods.

getCoreListType

protected abstract JClass getCoreListType()
Concrete class that implements the List interface. Used as the actual data storage.

getRawType

public JType getRawType()