|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface FieldAccessor
Encapsulates the access on a field.
Method Summary | |
---|---|
void |
add(com.sun.codemodel.JBlock body,
com.sun.codemodel.JExpression newValue)
Generate a code to add the "newValue" to this field and set it to the 'body'. |
void |
fromRawValue(com.sun.codemodel.JBlock block,
java.lang.String uniqueName,
com.sun.codemodel.JExpression $var)
Sets the value of the field from the specified expression. |
com.sun.codemodel.JExpression |
getContentValue()
Get the "content" of this field in one object. |
CPropertyInfo |
getPropertyInfo()
Short for owner().getPropertyInfo() |
com.sun.codemodel.JExpression |
hasSetValue()
Return an expression that evaluates to true only when this field has a set value(s). |
FieldOutline |
owner()
Gets the FieldOutline from which
this object is created. |
void |
toArray(com.sun.codemodel.JBlock block,
com.sun.codemodel.JExpression $array)
Dumps everything in this field into the given array, which is guaranteed to have the enough space to store all the values (that is, the caller is responsible for ensuring the size of the array.) The type of the array must be the same as getPropertyInfo().getType() . |
void |
toRawValue(com.sun.codemodel.JBlock block,
com.sun.codemodel.JVar $var)
Dumps everything in this field into the given variable. |
void |
unsetValues(com.sun.codemodel.JBlock body)
Generates a code fragment to remove any "set" value and move this field to the "unset" state. |
Method Detail |
---|
void add(com.sun.codemodel.JBlock body, com.sun.codemodel.JExpression newValue)
void toArray(com.sun.codemodel.JBlock block, com.sun.codemodel.JExpression $array)
getPropertyInfo().getType()
.
void toRawValue(com.sun.codemodel.JBlock block, com.sun.codemodel.JVar $var)
This generates code that accesses the field from outside.
block
- The code will be generated into this block.$var
- Variable whose type is FieldOutline.getRawType()
void fromRawValue(com.sun.codemodel.JBlock block, java.lang.String uniqueName, com.sun.codemodel.JExpression $var)
This generates code that accesses the field from outside.
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()
.void unsetValues(com.sun.codemodel.JBlock body)
body
- The code will be appended at the end of this block.com.sun.codemodel.JExpression hasSetValue()
com.sun.codemodel.JExpression getContentValue()
The notion of "content" is defined in the spec.
Typically, it is a single Object
that represents
the field. For fields with a primitive value, this is a boxed
type. For a list field, this is a List
.
This object will be returned from the getContent method of the choice content interface.
FieldOutline owner()
FieldOutline
from which
this object is created.
CPropertyInfo getPropertyInfo()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |