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

Class SingleField

public class SingleField extends AbstractFieldWithVar

Realizes a property through one getter and one setter. This renders:
 T' field;
 T getXXX() { ... }
 void setXXX(T value) { ... }
 

Normally T'=T, but under some tricky circumstances they could be different (like T'=Integer, T=int.) This realization is only applicable to fields with (1,1) or (0,1) multiplicity.

Nested Class Summary
protected classSingleField.Accessor
Constructor Summary
protected SingleField(ClassOutlineImpl context, CPropertyInfo prop)
protected SingleField(ClassOutlineImpl context, CPropertyInfo prop, boolean forcePrimitiveAccess)
Method Summary
FieldAccessorcreate(JExpression targetObject)
JTypegetFieldType()

Constructor Detail

SingleField

protected SingleField(ClassOutlineImpl context, CPropertyInfo prop)

SingleField

protected SingleField(ClassOutlineImpl context, CPropertyInfo prop, boolean forcePrimitiveAccess)

Parameters: forcePrimitiveAccess forces the setter/getter to expose the primitive type. it's a pointless customization, but it's nevertheless in the spec.

Method Detail

create

public FieldAccessor create(JExpression targetObject)

getFieldType

public final JType getFieldType()