Top Description Inners Fields Constructors Methods
com.sun.tools.xjc.generator.bean.field

pack-priv final Class ArrayField

extends AbstractListField
Class Inheritance
Imports
com.sun.codemodel.JAssignmentTarget, .JBlock, .JClass, .JExpr, .JExpression, .JForLoop, .JMethod, .JMod, .JOp, .JType, .JVar, java.util.List, com.sun.tools.xjc.generator.bean.ClassOutlineImpl, .MethodWriter, com.sun.tools.xjc.model.CPropertyInfo

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.
Author
Kohsuke Kawaguchi ([email protected])

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv class

Field Summary

Modifier and TypeField and Description
private JMethod
private JMethod
Inherited from com.sun.tools.xjc.generator.bean.field.AbstractListField:
fieldlistTprimitiveType

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
protected JExpression
public ArrayField.Accessor
create(JExpression targetObject)

Implements com.sun.tools.xjc.outline.FieldOutline.create.

Creates a new FieldAccessor of this field for the specified object.

public void
protected void
protected JClass
getCoreListType()

Implements abstract com.sun.tools.xjc.generator.bean.field.AbstractListField.getCoreListType.

Concrete class that implements the List interface.

public JType
Inherited from com.sun.tools.xjc.generator.bean.field.AbstractListField:
appendJavadocfixNullRefgenerate

Field Detail

$getAllback to summary
private JMethod $getAll
$setAllback to summary
private JMethod $setAll

Constructor Detail

ArrayFieldback to summary
pack-priv ArrayField(ClassOutlineImpl context, CPropertyInfo prop)

Method Detail

castToImplTypeArrayback to summary
protected JExpression castToImplTypeArray(JExpression exp)

Case from exposedType to array of implType .

createback to summary
public ArrayField.Accessor create(JExpression targetObject)

Implements com.sun.tools.xjc.outline.FieldOutline.create.

Doc from com.sun.tools.xjc.outline.FieldOutline.create.

Creates a new FieldAccessor of this field for the specified object.

Annotations
@Override
generateAccessorsback to summary
public void generateAccessors()

Implements abstract com.sun.tools.xjc.generator.bean.field.AbstractListField.generateAccessors.

Doc from com.sun.tools.xjc.generator.bean.field.AbstractListField.generateAccessors.

Generates accessor methods.

Annotations
@Override
generateArrayback to summary
protected void generateArray()
getCoreListTypeback to summary
protected JClass getCoreListType()

Implements abstract com.sun.tools.xjc.generator.bean.field.AbstractListField.getCoreListType.

Doc from com.sun.tools.xjc.generator.bean.field.AbstractListField.getCoreListType.

Concrete class that implements the List interface. Used as the actual data storage.

Annotations
@Override
getRawTypeback to summary
public JType getRawType()

Overrides com.sun.tools.xjc.generator.bean.field.AbstractListField.getRawType.

Implements com.sun.tools.xjc.outline.FieldOutline.getRawType.

Doc from com.sun.tools.xjc.outline.FieldOutline.getRawType.

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.

Annotations
@Override
com.sun.tools.xjc.generator.bean.field back to summary

pack-priv Class ArrayField.Accessor

extends Accessor
Class Inheritance

Field Summary

Inherited from com.sun.tools.xjc.generator.bean.field.AbstractListField.Accessor:
field

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public void
fromRawValue(JBlock block, String uniqueName, JExpression $var)

Implements com.sun.tools.xjc.outline.FieldAccessor.fromRawValue.

Sets the value of the field from the specified expression.

public JExpression
hasSetValue()

Overrides com.sun.tools.xjc.generator.bean.field.AbstractListField.Accessor.hasSetValue.

Implements com.sun.tools.xjc.outline.FieldAccessor.hasSetValue.

Return an expression that evaluates to true only when this field has a set value(s).

public void
toRawValue(JBlock block, JVar $var)

Implements com.sun.tools.xjc.outline.FieldAccessor.toRawValue.

Dumps everything in this field into the given variable.

Inherited from com.sun.tools.xjc.generator.bean.field.AbstractListField.Accessor:
boxcountrefunboxunsetValues

Constructor Detail

Accessorback to summary
protected Accessor(JExpression $target)

Method Detail

fromRawValueback to summary
public void fromRawValue(JBlock block, String uniqueName, JExpression $var)

Implements com.sun.tools.xjc.outline.FieldAccessor.fromRawValue.

Doc from com.sun.tools.xjc.outline.FieldAccessor.fromRawValue.

Sets the value of the field from the specified expression.

This generates code that accesses the field from outside.

Annotations
@Override
hasSetValueback to summary
public JExpression hasSetValue()

Overrides com.sun.tools.xjc.generator.bean.field.AbstractListField.Accessor.hasSetValue.

Implements com.sun.tools.xjc.outline.FieldAccessor.hasSetValue.

Doc from com.sun.tools.xjc.outline.FieldAccessor.hasSetValue.

Return an expression that evaluates to true only when this field has a set value(s).

Annotations
@Override
toRawValueback to summary
public void toRawValue(JBlock block, JVar $var)

Implements com.sun.tools.xjc.outline.FieldAccessor.toRawValue.

Doc from com.sun.tools.xjc.outline.FieldAccessor.toRawValue.

Dumps everything in this field into the given variable.

This generates code that accesses the field from outside.

Annotations
@Override