Top Description Methods
com.sun.tools.xjc.outline

public Interface FieldAccessor

Known Direct Implementers
com.sun.tools.xjc.api.impl.s2j.ElementAdapter.FieldAccessorImpl, com.sun.tools.xjc.generator.bean.field.AbstractField.Accessor
Imports
com.sun.codemodel.JBlock, .JExpression, .JVar, com.sun.tools.xjc.model.CPropertyInfo

Encapsulates the access on a field.
Author
Kohsuke Kawaguchi ([email protected])

Method Summary

Modifier and TypeMethod and Description
public void
fromRawValue(JBlock
The code will be generated into this block.
block
,
String
Identifier that the caller guarantees to be unique in the given block. When the callee needs to produce additional variables, it can do so by adding suffixes to this unique name. For example, if the uniqueName is "abc", then the caller guarantees that any identifier "abc.*" is unused in this block.
uniqueName
,
JExpression
The expression that evaluates to a value of the type FieldOutline#getRawType().
$var
)

Sets the value of the field from the specified expression.

public CPropertyInfo
getPropertyInfo()

Short for owner().getPropertyInfo()

public JExpression

Returns:

null if the isSetXXX/unsetXXX method does not make sense for the given field.
hasSetValue
()

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

public FieldOutline
owner()

Gets the FieldOutline from which this object is created.

public void
toRawValue(JBlock
The code will be generated into this block.
block
,
JVar
Variable whose type is FieldOutline#getRawType()
$var
)

Dumps everything in this field into the given variable.

public void
unsetValues(JBlock
The code will be appended at the end of this block.
body
)

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

Method Detail

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

Sets the value of the field from the specified expression.

This generates code that accesses the field from outside.

Parameters
block:JBlock

The code will be generated into this block.

uniqueName:String

Identifier that the caller guarantees to be unique in the given block. When the callee needs to produce additional variables, it can do so by adding suffixes to this unique name. For example, if the uniqueName is "abc", then the caller guarantees that any identifier "abc.*" is unused in this block.

$var:JExpression

The expression that evaluates to a value of the type FieldOutline#getRawType().

getPropertyInfoback to summary
public CPropertyInfo getPropertyInfo()

Short for owner().getPropertyInfo()

hasSetValueback to summary
public JExpression hasSetValue()

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

Returns:JExpression

null if the isSetXXX/unsetXXX method does not make sense for the given field.

ownerback to summary
public FieldOutline owner()

Gets the FieldOutline from which this object is created.

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

Dumps everything in this field into the given variable.

This generates code that accesses the field from outside.

Parameters
block:JBlock

The code will be generated into this block.

$var:JVar

Variable whose type is FieldOutline#getRawType()

unsetValuesback to summary
public void unsetValues(JBlock body)

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

Parameters
body:JBlock

The code will be appended at the end of this block.