com.sun.tools.xjc.generator.bean.field
Class AbstractFieldWithVar.Accessor

java.lang.Object
  extended by com.sun.tools.xjc.generator.bean.field.AbstractField.Accessor
      extended by com.sun.tools.xjc.generator.bean.field.AbstractFieldWithVar.Accessor
All Implemented Interfaces:
FieldAccessor
Direct Known Subclasses:
SingleField.Accessor
Enclosing class:
AbstractFieldWithVar

protected abstract class AbstractFieldWithVar.Accessor
extends AbstractField.Accessor


Field Summary
protected  com.sun.codemodel.JFieldRef $ref
          Reference to the field bound by the target object.
 
Fields inherited from class com.sun.tools.xjc.generator.bean.field.AbstractField.Accessor
$target
 
Constructor Summary
protected AbstractFieldWithVar.Accessor(com.sun.codemodel.JExpression $target)
           
 
Method Summary
 void fromRawValue(com.sun.codemodel.JBlock block, String uniqueName, com.sun.codemodel.JExpression $var)
          Sets the value of the field from the specified expression.
 void toRawValue(com.sun.codemodel.JBlock block, com.sun.codemodel.JVar $var)
          Dumps everything in this field into the given variable.
 
Methods inherited from class com.sun.tools.xjc.generator.bean.field.AbstractField.Accessor
getPropertyInfo, owner
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.sun.tools.xjc.outline.FieldAccessor
hasSetValue, unsetValues
 

Field Detail

$ref

protected final com.sun.codemodel.JFieldRef $ref
Reference to the field bound by the target object.

Constructor Detail

AbstractFieldWithVar.Accessor

protected AbstractFieldWithVar.Accessor(com.sun.codemodel.JExpression $target)
Method Detail

toRawValue

public final void toRawValue(com.sun.codemodel.JBlock block,
                             com.sun.codemodel.JVar $var)
Description copied from interface: FieldAccessor
Dumps everything in this field into the given variable.

This generates code that accesses the field from outside.

Parameters:
block - The code will be generated into this block.
$var - Variable whose type is FieldOutline.getRawType()

fromRawValue

public final void fromRawValue(com.sun.codemodel.JBlock block,
                               String uniqueName,
                               com.sun.codemodel.JExpression $var)
Description copied from interface: FieldAccessor
Sets the value of the field from the specified expression.

This generates code that accesses the field from outside.

Parameters:
block - The code will be generated into this block.
uniqueName - 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 - The expression that evaluates to a value of the type FieldOutline.getRawType().