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

pack-priv final Class ConstField

extends AbstractField
Class Inheritance
Imports
com.sun.codemodel.JBlock, .JExpression, .JFieldVar, .JMod, .JPrimitiveType, .JType, .JVar, com.sun.tools.xjc.generator.bean.ClassOutlineImpl, com.sun.tools.xjc.model.CPropertyInfo, com.sun.tools.xjc.outline.FieldAccessor

Realizes a property as a "public static final" property on the interface. This class can handle both boxed/unboxed types and both single/colllection.
Author
Kohsuke Kawaguchi ([email protected])

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class

Field Summary

Modifier and TypeField and Description
private final JFieldVar
$ref

Generated constant property on the interface.

Inherited from com.sun.tools.xjc.generator.bean.field.AbstractField:
codeModelexposedTypeimplTypeoutlineprop

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public FieldAccessor
create(JExpression target)

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

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

public JType
getRawType()

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

Gets the type of the "raw value".

Inherited from com.sun.tools.xjc.generator.bean.field.AbstractField:
annotatecastToImplTypegenerateFieldgetOptionsgetPropertyInfogetTypelistPossibleTypesparent

Field Detail

$refback to summary
private final JFieldVar $ref

Generated constant property on the interface.

Constructor Detail

ConstFieldback to summary
pack-priv ConstField(ClassOutlineImpl outline, CPropertyInfo prop)

Method Detail

createback to summary
public FieldAccessor create(JExpression target)

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
getRawTypeback to summary
public JType 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

private Class ConstField.Accessor

extends Accessor
Class Inheritance

Field Summary

Inherited from com.sun.tools.xjc.generator.bean.field.AbstractField.Accessor:
$target

Constructor Summary

AccessConstructor and Description
pack-priv

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()

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.

public void
unsetValues(JBlock body)

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

Generates a code fragment to remove any "set" value and move this field to the "unset" state.

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

Constructor Detail

Accessorback to summary
pack-priv 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()

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
unsetValuesback to summary
public void unsetValues(JBlock body)

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

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

Generates a code fragment to remove any "set" value and move this field to the "unset" state.

Annotations
@Override