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

Class AbstractField

abstract class AbstractField extends Object implements FieldOutline

Useful base class for implementing FieldOutline.

This class just provides a few utility methods and keep some important variables so that they can be readily accessed any time.

Nested Class Summary
protected abstract classAbstractField.Accessor
Useful base class for implementing FieldAccessor.
Field Summary
protected JCodeModelcodeModel
protected JTypeexposedType
The publicly visible type of this field.
protected JTypeimplType
The type of this field, which can hold all the possible types.
protected ClassOutlineImploutline
protected CPropertyInfoprop
Constructor Summary
protected AbstractField(ClassOutlineImpl outline, CPropertyInfo prop)
Method Summary
protected voidannotate(JAnnotatable field)
Annotate the field according to the recipes given as CPropertyInfo.
protected JExpressioncastToImplType(JExpression exp)
Case from exposedType to implType if necessary.
protected JFieldVargenerateField(JType type)
Generates the field declaration.
protected OptionsgetOptions()
Gets the Options in the current compilation context.
CPropertyInfogetPropertyInfo()
protected JTypegetType(Aspect aspect)
Compute the type of a
protected List<Object>listPossibleTypes(CPropertyInfo prop)
Returns contents to be added to javadoc.
ClassOutlineparent()

Field Detail

codeModel

protected final JCodeModel codeModel

exposedType

protected final JType exposedType
The publicly visible type of this field. If we are generating value classes implType==exposedType.

implType

protected final JType implType
The type of this field, which can hold all the possible types.

outline

protected final ClassOutlineImpl outline

prop

protected final CPropertyInfo prop

Constructor Detail

AbstractField

protected AbstractField(ClassOutlineImpl outline, CPropertyInfo prop)

Method Detail

annotate

protected void annotate(JAnnotatable field)
Annotate the field according to the recipes given as CPropertyInfo.

castToImplType

protected final JExpression castToImplType(JExpression exp)
Case from exposedType to implType if necessary.

generateField

protected final JFieldVar generateField(JType type)
Generates the field declaration.

getOptions

protected final Options getOptions()
Gets the Options in the current compilation context.

getPropertyInfo

public final CPropertyInfo getPropertyInfo()

getType

protected JType getType(Aspect aspect)
Compute the type of a CPropertyInfo

Parameters: aspect

listPossibleTypes

protected final List<Object> listPossibleTypes(CPropertyInfo prop)
Returns contents to be added to javadoc.

parent

public final ClassOutline parent()