public class PropertyDefinition
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static java.lang.String[] |
FLAG_METHOD_SIGNATURES |
private static java.lang.String[] |
GET_METHOD_SIGNATURES |
private ClassItem |
m_fieldItem
Information for field (if given, may be
null ). |
private ClassItem |
m_flagMethod
Information for flag method (if given, may be
null ). |
private ClassItem |
m_getMethod
Information for get method (if given, may be
null ). |
private java.lang.String |
m_getValueType
Fully qualified name of declared type of value loaded.
|
private boolean |
m_isImplicit
Reference to implicit value from collection.
|
private boolean |
m_isOptional
Optional item flag.
|
private boolean |
m_isThis
Reference to "this" property of object flag.
|
private IContextObj |
m_objContext
Containing object context.
|
private ClassItem |
m_setMethod
Information for set method (if given, may be
null ). |
private java.lang.String |
m_setValueType
Fully qualified name of declared type of value stored.
|
private ClassItem |
m_testMethod
Information for test method (if given, may be
null ). |
private java.lang.String |
m_typeName
Fully qualified name of actual type of value.
|
private static java.lang.String[] |
TEST_METHOD_SIGNATURES |
Constructor and Description |
---|
PropertyDefinition(IContainer parent,
IContextObj obj,
java.lang.String type,
boolean isthis,
boolean opt,
java.lang.String fname,
java.lang.String test,
java.lang.String flag,
java.lang.String get,
java.lang.String set)
Constructor.
|
PropertyDefinition(IContextObj obj,
boolean opt)
Constructor for "this" object reference.
|
PropertyDefinition(PropertyDefinition original)
Copy constructor.
|
PropertyDefinition(java.lang.String type,
IContextObj obj,
boolean opt)
Constructor for implicit object reference.
|
Modifier and Type | Method and Description |
---|---|
private void |
discardValue(MethodBuilder mb)
Append instruction to pop the value from the stack.
|
private void |
duplicateValue(MethodBuilder mb)
Append instruction to duplicate the value on the stack.
|
void |
genFlag(MethodBuilder mb)
Generate code to call flag method with value on stack.
|
void |
genLoad(ContextMethodBuilder mb)
Generate code to load property value to stack.
|
void |
genStore(MethodBuilder mb)
Generate code to store property value from stack.
|
BranchWrapper |
genTest(ContextMethodBuilder mb)
Generate code to test if property is present.
|
java.lang.String |
getGetValueType()
Get value type as fully qualified name for loaded property value.
|
java.lang.String |
getName()
Get property name.
|
java.lang.String |
getSetValueType()
Get value type as fully qualified name for stored property value.
|
java.lang.String |
getTypeName()
Get declared type fully qualified name.
|
boolean |
hasFlag()
Check if property has flag method.
|
boolean |
hasTest()
Check if property has presence test.
|
boolean |
isFlagOnly()
Check if property is flag only.
|
boolean |
isImplicit()
Check if property is implicit value from collection.
|
boolean |
isLoadable()
Check if the value can be loaded.
|
boolean |
isOptional()
Check if property is optional.
|
boolean |
isTestOnly()
Check if property is test only.
|
boolean |
isThis()
Check if property is "this" reference for object.
|
void |
setOptional(boolean opt)
Set flag for an optional property.
|
void |
switchProperty()
Switch property from "this" to "implicit".
|
java.lang.String |
toString() |
private static final java.lang.String[] TEST_METHOD_SIGNATURES
private static final java.lang.String[] GET_METHOD_SIGNATURES
private static final java.lang.String[] FLAG_METHOD_SIGNATURES
private boolean m_isThis
private boolean m_isImplicit
private boolean m_isOptional
private final IContextObj m_objContext
private final java.lang.String m_typeName
private final java.lang.String m_getValueType
private final java.lang.String m_setValueType
private final ClassItem m_fieldItem
null
).private final ClassItem m_testMethod
null
).private final ClassItem m_flagMethod
null
).private final ClassItem m_getMethod
null
).private final ClassItem m_setMethod
null
).public PropertyDefinition(IContainer parent, IContextObj obj, java.lang.String type, boolean isthis, boolean opt, java.lang.String fname, java.lang.String test, java.lang.String flag, java.lang.String get, java.lang.String set) throws JiBXException
parent
- containing binding definition structureobj
- containing object contexttype
- fully qualified name of typeisthis
- "this" object reference flagopt
- optional property flagfname
- containing object field name for property (may be
null
)test
- containing object method to test for property present (may be
null
)flag
- containing object method to flag property present (may be
null
)get
- containing object method to get property value (may be
null
)set
- containing object method to set property value (may be
null
)JiBXException
- if configuration errorpublic PropertyDefinition(IContextObj obj, boolean opt)
obj
- containing object contextopt
- optional property flagpublic PropertyDefinition(java.lang.String type, IContextObj obj, boolean opt)
type
- object type suppliedobj
- containing object contextopt
- optional property flagpublic PropertyDefinition(PropertyDefinition original)
original
- public boolean isThis()
true
if reference to "this", false
if
notpublic boolean isImplicit()
true
if implicit, false
if notpublic void switchProperty()
public boolean isOptional()
true
if optional, false
if requiredpublic void setOptional(boolean opt)
opt
- true
if optional property, false
if
notpublic boolean isLoadable()
true
if loadable, false
if notpublic java.lang.String getName()
public java.lang.String getTypeName()
public java.lang.String getGetValueType()
public java.lang.String getSetValueType()
public boolean hasTest()
true
if presence test needed, false
if
notpublic boolean isTestOnly()
true
if test-only property, false
if
notpublic boolean hasFlag()
true
if flag method defined, false
if
notpublic boolean isFlagOnly()
true
if flag-only property, false
if
notprivate void duplicateValue(MethodBuilder mb)
mb
- private void discardValue(MethodBuilder mb)
mb
- public BranchWrapper genTest(ContextMethodBuilder mb) throws JiBXException
mb
- method builderJiBXException
public void genFlag(MethodBuilder mb) throws JiBXException
mb
- method builderJiBXException
- if configuration errorpublic void genLoad(ContextMethodBuilder mb) throws JiBXException
mb
- method builderJiBXException
- if configuration errorpublic void genStore(MethodBuilder mb) throws JiBXException
mb
- method builderJiBXException
- if configuration errorpublic java.lang.String toString()
toString
in class java.lang.Object