| java.lang.Object org.jibx.binding.def.PropertyDefinition
PropertyDefinition | public class PropertyDefinition (Code) | | Property definition from binding. This organizes shared information for
bindings linked to fields or get/set methods of an object, and provides
methods for related code generation.
author: Dennis M. Sosnoski |
Constructor Summary | |
public | PropertyDefinition(IContainer parent, IContextObj obj, String type, boolean isthis, boolean opt, String fname, String test, String get, String set) Constructor. | public | PropertyDefinition(IContextObj obj, boolean opt) Constructor for "this" object reference. | public | PropertyDefinition(String type, IContextObj obj, boolean opt) Constructor for implicit object reference. |
PropertyDefinition | public PropertyDefinition(IContainer parent, IContextObj obj, String type, boolean isthis, boolean opt, String fname, String test, String get, String set) throws JiBXException(Code) | | Constructor.
Parameters: parent - containing binding definition structure Parameters: obj - containing object context Parameters: type - fully qualified name of type Parameters: isthis - "this" object reference flag Parameters: opt - optional property flag Parameters: fname - containing object field name for property (may benull ) Parameters: test - containing object method to test for property present (may benull ) Parameters: get - containing object method to get property value (may benull ) Parameters: set - containing object method to set property value (may benull ) throws: JiBXException - if configuration error |
PropertyDefinition | public PropertyDefinition(IContextObj obj, boolean opt)(Code) | | Constructor for "this" object reference.
Parameters: obj - containing object context Parameters: opt - optional property flag |
PropertyDefinition | public PropertyDefinition(String type, IContextObj obj, boolean opt)(Code) | | Constructor for implicit object reference.
Parameters: type - object type supplied Parameters: obj - containing object context Parameters: opt - optional property flag |
genLoad | public void genLoad(ContextMethodBuilder mb) throws JiBXException(Code) | | Generate code to load property value to stack. The generated code
assumes that the top of the stack is the reference for the containing
object. It consumes this and leaves the actual value on the stack. If
the property value is not directly accessible from the context of the
method being generated this automatically constructs an access method
and uses that method.
Parameters: mb - method builder throws: JiBXException - if configuration error |
genStore | public void genStore(MethodBuilder mb) throws JiBXException(Code) | | Generate code to store property value from stack. The generated code
assumes that the reference to the containing object and the value to be
stored have already been pushed on the stack. It consumes these, leaving
nothing. If the property value is not directly accessible from the
context of the method being generated this automatically constructs an
access method and uses that method.
Parameters: mb - method builder throws: JiBXException - if configuration error |
genTest | public BranchWrapper genTest(ContextMethodBuilder mb)(Code) | | Generate code to test if property is present. The generated code
assumes that the top of the stack is the reference for the containing
object, and consumes this value for the test. The target for the
returned branch instruction must be set by the caller.
Parameters: mb - method builder wrapper for branch instruction taken when property is missing |
getGetValueType | public String getGetValueType()(Code) | | Get value type as fully qualified name for loaded property value.
fully qualified class name of value type |
getName | public String getName()(Code) | | Get property name. If a field is defined this is the same as the field;
otherwise it is either the get method name (with leading "get" stripped,
if present) or the set method (with leading "set" stripped, if present),
whichever is found.
name for this property |
getSetValueType | public String getSetValueType()(Code) | | Get value type as fully qualified name for stored property value.
fully qualified class name of value type |
getTypeName | public String getTypeName()(Code) | | Get declared type fully qualified name.
fully qualified class name of declared type |
hasTest | public boolean hasTest()(Code) | | Check if property has presence test. Code needs to be generated to check
for the presence of the property if it is optional and either a test
method is defined or the value is an object reference.
true if presence test needed, false ifnot |
isImplicit | public boolean isImplicit()(Code) | | Check if property is implicit value from collection.
true if implicit, false if not |
isOptional | public boolean isOptional()(Code) | | Check if property is optional.
true if optional, false if required |
isThis | public boolean isThis()(Code) | | Check if property is "this" reference for object.
true if reference to "this", false ifnot |
setOptional | public void setOptional(boolean opt)(Code) | | Set flag for an optional property.
Parameters: opt - true if optional property, false ifnot |
switchProperty | public void switchProperty()(Code) | | Switch property from "this" to "implicit".
|
|
|