Package com.sun.tools.xjc.outline
Interface FieldAccessor
-
- All Known Implementing Classes:
SingleField.Accessor
public interface FieldAccessor
Encapsulates the access on a field.- Author:
- Kohsuke Kawaguchi ([email protected])
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
fromRawValue(JBlock block, String uniqueName, JExpression $var)
Sets the value of the field from the specified expression.CPropertyInfo
getPropertyInfo()
Short forowner().getPropertyInfo()
JExpression
hasSetValue()
Return an expression that evaluates to true only when this field has a set value(s).FieldOutline
owner()
Gets theFieldOutline
from which this object is created.void
toRawValue(JBlock block, JVar $var)
Dumps everything in this field into the given variable.void
unsetValues(JBlock body)
Generates a code fragment to remove any "set" value and move this field to the "unset" state.
-
-
-
Method Detail
-
toRawValue
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
- The code will be generated into this block.$var
- Variable whose type isFieldOutline.getRawType()
-
fromRawValue
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
- 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 typeFieldOutline.getRawType()
.
-
unsetValues
void unsetValues(JBlock body)
Generates a code fragment to remove any "set" value and move this field to the "unset" state.- Parameters:
body
- The code will be appended at the end of this block.
-
hasSetValue
JExpression hasSetValue()
Return an expression that evaluates to true only when this field has a set value(s).- Returns:
- null if the isSetXXX/unsetXXX method does not make sense for the given field.
-
owner
FieldOutline owner()
Gets theFieldOutline
from which this object is created.
-
getPropertyInfo
CPropertyInfo getPropertyInfo()
Short forowner().getPropertyInfo()
-
-