|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jibx.binding.def.PassThroughComponent
org.jibx.binding.def.ObjectBinding
public class ObjectBinding
Binding modifiers that apply to a class reference. This adds the methods used for handling binding operations to the object class, then generates calls to the added methods as this binding definition is used.
Field Summary | |
---|---|
private static org.apache.bcel.generic.Type[] |
EMPTY_ARGS
|
private static java.lang.String[] |
FACTORY_HOOK_SIGNATURES
|
private static java.lang.String |
GETSTACKTOP_SIGNATURE
|
private BoundClass |
m_class
Class linked to mapping. |
private IContainer |
m_container
Containing binding definition structure. |
private ClassFile |
m_createClass
Type to be used for creating new instances. |
private ClassItem |
m_factoryMethod
Object factory method. |
private IComponent |
m_idChild
Child supplying instance identifier value. |
private boolean |
m_isStaticMarshal
Flag for static marshal methods. |
private boolean |
m_isStaticUnmarshal
Flag for static unmarshal methods. |
private boolean |
m_isThisBinding
Flag for "this" reference, meaning that there's no separate object instance created. |
private boolean |
m_lockAttributeMarshal
Flag for recursion while generating attribute marshal. |
private boolean |
m_lockAttributeUnmarshal
Flag for recursion while generating attribute unmarshal. |
private boolean |
m_lockContentMarshal
Flag for recursion while generating attribute marshal. |
private boolean |
m_lockContentUnmarshal
Flag for recursion while generating attribute unmarshal. |
private ClassItem |
m_marshalAttributeMethod
Generated marshal attribute method. |
private java.lang.String |
m_marshalAttributeName
Name for marshal attribute method ( null unless
generation started). |
private ClassItem |
m_marshalContentMethod
Generated marshal content method. |
private java.lang.String |
m_marshalContentName
Name for marshal content method ( null unless
generation istarted). |
private java.lang.String |
m_marshalSignature
Signature used for marshal methods. |
private ClassItem |
m_newInstanceMethod
Generated new instance method. |
private ClassItem |
m_postSetMethod
Postset method for object. |
private ClassItem |
m_preGetMethod
Preget method for object. |
private ClassItem |
m_preSetMethod
Preset method for object. |
private ClassItem |
m_unmarshalAttributeMethod
Generated unmarshal attribute method. |
private java.lang.String |
m_unmarshalAttributeName
Name for unmarshal attribute method ( null unless
generation started). |
private ClassItem |
m_unmarshalContentMethod
Generated unmarshal content method. |
private java.lang.String |
m_unmarshalContentName
Name for unmarshal content method ( null unless
generation started). |
private java.lang.String |
m_unmarshalSignature
Signature used for unmarshal methods. |
private static java.lang.String |
MARSHAL_ATTR_SUFFIX
|
private static java.lang.String |
MARSHAL_GETSTACKTOPMETHOD
|
private static java.lang.String[] |
MARSHAL_HOOK_SIGNATURES
|
private static java.lang.String |
MARSHAL_POPOBJECTMETHOD
|
private static java.lang.String |
MARSHAL_PUSHOBJECTMETHOD
|
private static java.lang.String |
MARSHAL_SUFFIX
|
private static java.lang.String |
MARSHALLING_CONTEXT
|
private static java.lang.String |
NEWINSTANCE_SUFFIX
|
private static java.lang.String |
POPOBJECT_SIGNATURE
|
private static java.lang.String |
PUSHOBJECT_SIGNATURE
|
private static org.apache.bcel.generic.Type[] |
SETSOURCE_ARGS
|
private static java.lang.String |
SETSOURCE_METHODNAME
|
private static java.lang.String |
SOURCE_TRACKING_INTERFACE
|
private static java.lang.String |
SOURCECOLUMN_FIELDNAME
|
private static java.lang.String |
SOURCECOLUMN_METHODNAME
|
private static java.lang.String |
SOURCEDOCUMENT_FIELDNAME
|
private static java.lang.String |
SOURCELINE_FIELDNAME
|
private static java.lang.String |
SOURCELINE_METHODNAME
|
private static java.lang.String |
SOURCENAME_METHODNAME
|
private static java.lang.String |
UNMARSHAL_ATTR_SUFFIX
|
private static java.lang.String |
UNMARSHAL_GETSTACKTOPMETHOD
|
private static java.lang.String[] |
UNMARSHAL_HOOK_SIGNATURES
|
private static java.lang.String |
UNMARSHAL_PARAMETER_SIGNATURE
|
private static java.lang.String |
UNMARSHAL_POPOBJECTMETHOD
|
private static java.lang.String |
UNMARSHAL_PUSHOBJECTMETHOD
|
private static java.lang.String |
UNMARSHAL_PUSHTRACKEDOBJECTMETHOD
|
private static java.lang.String |
UNMARSHAL_SUFFIX
|
private static java.lang.String |
UNMARSHALLING_CONTEXT
|
Fields inherited from class org.jibx.binding.def.PassThroughComponent |
---|
m_component |
Constructor Summary | |
---|---|
ObjectBinding(IContainer contain,
IContextObj objc,
java.lang.String type,
java.lang.String fact,
java.lang.String pres,
java.lang.String posts,
java.lang.String pget,
java.lang.String ctype)
Constructor. |
|
ObjectBinding(IContainer contain,
ObjectBinding base)
Copy constructor. |
|
ObjectBinding(ObjectBinding base)
Abstract binding copy constructor. |
Method Summary | |
---|---|
private java.lang.String |
fullMethodName(ClassItem item)
Construct fully-qualified class and method name for constructed method. |
private java.lang.String |
fullMethodName(ContextMethodBuilder mb)
Construct fullly-qualified class and method name for method under construction. |
void |
genAttributeMarshal(ContextMethodBuilder mb)
Generate attribute marshalling code. |
void |
genAttributeUnmarshal(ContextMethodBuilder mb)
Generate attribute unmarshalling code. |
void |
genContentMarshal(ContextMethodBuilder mb)
Generate element or text marshalling code. |
void |
genContentUnmarshal(ContextMethodBuilder mb)
Generate element or text unmarshalling code. |
void |
genLoadId(ContextMethodBuilder mb)
Generate code to load ID value of instance to stack. |
private void |
genMarshalAttributeCall(ContextMethodBuilder mb)
Generate call to attribute marshal method for object. |
private void |
genMarshalCall(java.lang.String name,
ContextMethodBuilder mb)
Generate call to a constructed marshal method. |
private void |
genMarshalContentCall(ContextMethodBuilder mb)
Generate call to content marshal method for object. |
void |
genNewInstance(ContextMethodBuilder mb)
Generate code to create new instance of object. |
private void |
genNewInstanceCall(ContextMethodBuilder mb)
Generate call to new instance creation method for object. |
private boolean |
genNewInstanceCode(ContextMethodBuilder mb)
Generate code to create an instance of the object for this mapping. |
private void |
genTrackSourceCode()
Generate code to handle unmarshal source location tracking. |
private void |
genUnmarshalAttributeCall(ContextMethodBuilder mb)
Generate call to attribute unmarshal method for object. |
private void |
genUnmarshalCall(java.lang.String name,
ContextMethodBuilder mb)
Generate call to a constructed unmarshal method. |
private void |
genUnmarshalContentCall(ContextMethodBuilder mb)
Generate call to content unmarshal method for object. |
private void |
genUserMethodCall(boolean in,
ClassItem method,
ContextMethodBuilder mb)
Generate code for calling a user supplied method. |
BoundClass |
getBoundClass()
Get class linked to binding element. |
java.lang.String |
getType()
Get type expected by component. |
boolean |
hasId()
Check if component defines an ID value for instances of context object. |
boolean |
isOptional()
Check if component is an optional item. |
void |
print(int depth)
|
boolean |
setIdChild(IComponent child)
Set ID property. |
void |
setLinkages()
Establish and validate linkages between binding components. |
Methods inherited from class org.jibx.binding.def.PassThroughComponent |
---|
genAttrPresentTest, genContentPresentTest, getWrapperName, hasAttribute, hasContent, setWrappedComponent |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.jibx.binding.def.IComponent |
---|
genAttrPresentTest, genContentPresentTest, getWrapperName, hasAttribute, hasContent |
Field Detail |
---|
private static final java.lang.String[] MARSHAL_HOOK_SIGNATURES
private static final java.lang.String[] FACTORY_HOOK_SIGNATURES
private static final java.lang.String[] UNMARSHAL_HOOK_SIGNATURES
private static final java.lang.String UNMARSHAL_GETSTACKTOPMETHOD
private static final java.lang.String MARSHAL_GETSTACKTOPMETHOD
private static final java.lang.String GETSTACKTOP_SIGNATURE
private static final java.lang.String MARSHALLING_CONTEXT
private static final java.lang.String UNMARSHALLING_CONTEXT
private static final java.lang.String UNMARSHAL_PARAMETER_SIGNATURE
private static final java.lang.String UNMARSHAL_PUSHOBJECTMETHOD
private static final java.lang.String UNMARSHAL_PUSHTRACKEDOBJECTMETHOD
private static final java.lang.String MARSHAL_PUSHOBJECTMETHOD
private static final java.lang.String PUSHOBJECT_SIGNATURE
private static final java.lang.String UNMARSHAL_POPOBJECTMETHOD
private static final java.lang.String MARSHAL_POPOBJECTMETHOD
private static final java.lang.String POPOBJECT_SIGNATURE
private static final java.lang.String NEWINSTANCE_SUFFIX
private static final java.lang.String UNMARSHAL_ATTR_SUFFIX
private static final java.lang.String MARSHAL_ATTR_SUFFIX
private static final java.lang.String UNMARSHAL_SUFFIX
private static final java.lang.String MARSHAL_SUFFIX
private static final java.lang.String SOURCE_TRACKING_INTERFACE
private static final java.lang.String SETSOURCE_METHODNAME
private static final org.apache.bcel.generic.Type[] SETSOURCE_ARGS
private static final java.lang.String SOURCEDOCUMENT_FIELDNAME
private static final java.lang.String SOURCELINE_FIELDNAME
private static final java.lang.String SOURCECOLUMN_FIELDNAME
private static final java.lang.String SOURCENAME_METHODNAME
private static final java.lang.String SOURCELINE_METHODNAME
private static final java.lang.String SOURCECOLUMN_METHODNAME
private static final org.apache.bcel.generic.Type[] EMPTY_ARGS
private final IContainer m_container
private BoundClass m_class
private final ClassItem m_factoryMethod
private final ClassItem m_preSetMethod
private final ClassItem m_postSetMethod
private final ClassItem m_preGetMethod
private final ClassFile m_createClass
private ClassItem m_newInstanceMethod
private boolean m_lockAttributeUnmarshal
private boolean m_lockAttributeMarshal
private boolean m_lockContentUnmarshal
private boolean m_lockContentMarshal
private java.lang.String m_unmarshalSignature
private java.lang.String m_unmarshalAttributeName
null
unless
generation started).
private java.lang.String m_unmarshalContentName
null
unless
generation started).
private boolean m_isStaticUnmarshal
private boolean m_isStaticMarshal
private java.lang.String m_marshalSignature
private java.lang.String m_marshalAttributeName
null
unless
generation started).
private java.lang.String m_marshalContentName
null
unless
generation istarted).
private ClassItem m_unmarshalAttributeMethod
private ClassItem m_unmarshalContentMethod
private ClassItem m_marshalAttributeMethod
private ClassItem m_marshalContentMethod
private IComponent m_idChild
private boolean m_isThisBinding
Constructor Detail |
---|
public ObjectBinding(IContainer contain, IContextObj objc, java.lang.String type, java.lang.String fact, java.lang.String pres, java.lang.String posts, java.lang.String pget, java.lang.String ctype) throws JiBXException
contain
- containing binding definition componentobjc
- current object contexttype
- fully qualified class name for bound objectfact
- user new instance factory methodpres
- user preset method for unmarshallingposts
- user postset method for unmarshallingpget
- user preget method for marshallingctype
- type to use for creating new instance (null
if
not specified)
JiBXException
- if method not foundpublic ObjectBinding(ObjectBinding base)
base
- original object bindingpublic ObjectBinding(IContainer contain, ObjectBinding base)
contain
- binding definition component for constructed copybase
- instance to be copiedMethod Detail |
---|
private void genUserMethodCall(boolean in, ClassItem method, ContextMethodBuilder mb)
in
- flag for unmarshalling methodmethod
- information for method being calledmb
- method builder for generated codeprivate boolean genNewInstanceCode(ContextMethodBuilder mb) throws JiBXException
mb
- method builder
true
if able to create instance, false
if not
JiBXException
- if error in generating codeprivate void genNewInstanceCall(ContextMethodBuilder mb) throws JiBXException
mb
- method builder
JiBXException
- if error in configurationprivate void genTrackSourceCode() throws JiBXException
JiBXException
- if error in generating codeprivate java.lang.String fullMethodName(ContextMethodBuilder mb)
mb
- method to be named
private java.lang.String fullMethodName(ClassItem item)
item
- method to be named
private void genUnmarshalCall(java.lang.String name, ContextMethodBuilder mb)
name
- mb
- private void genMarshalCall(java.lang.String name, ContextMethodBuilder mb)
name
- mb
- private void genUnmarshalAttributeCall(ContextMethodBuilder mb) throws JiBXException
mb
- method builder
JiBXException
- if error in configurationprivate void genMarshalAttributeCall(ContextMethodBuilder mb) throws JiBXException
mb
- method builder
JiBXException
- if error in configurationprivate void genUnmarshalContentCall(ContextMethodBuilder mb) throws JiBXException
mb
- method builder
JiBXException
- if error in configurationprivate void genMarshalContentCall(ContextMethodBuilder mb) throws JiBXException
mb
- method builder
JiBXException
- if error in configurationpublic BoundClass getBoundClass()
IContextObj
getBoundClass
in interface IContextObj
public boolean setIdChild(IComponent child)
IContextObj
setIdChild
in interface IContextObj
child
- child defining the ID property
true
if successful, false
if ID
already definedpublic boolean isOptional()
IComponent
isOptional
in interface IComponent
isOptional
in class PassThroughComponent
true
if optional, false
if requiredpublic void genAttributeUnmarshal(ContextMethodBuilder mb) throws JiBXException
IComponent
genAttributeUnmarshal
in interface IComponent
genAttributeUnmarshal
in class PassThroughComponent
mb
- method builder
JiBXException
- if error in configurationpublic void genAttributeMarshal(ContextMethodBuilder mb) throws JiBXException
IComponent
genAttributeMarshal
in interface IComponent
genAttributeMarshal
in class PassThroughComponent
mb
- method builder
JiBXException
- if error in configurationpublic void genContentUnmarshal(ContextMethodBuilder mb) throws JiBXException
IComponent
genContentUnmarshal
in interface IComponent
genContentUnmarshal
in class PassThroughComponent
mb
- method builder
JiBXException
- if error in configurationpublic void genContentMarshal(ContextMethodBuilder mb) throws JiBXException
IComponent
genContentMarshal
in interface IComponent
genContentMarshal
in class PassThroughComponent
mb
- method builder
JiBXException
- if error in configurationpublic void genNewInstance(ContextMethodBuilder mb) throws JiBXException
IComponent
genNewInstance
in interface IComponent
genNewInstance
in class PassThroughComponent
mb
- method builder
JiBXException
- if error in configurationpublic java.lang.String getType()
IComponent
getType
in interface IComponent
getType
in class PassThroughComponent
public boolean hasId()
IComponent
hasId
in interface IComponent
hasId
in class PassThroughComponent
true
if ID value defined for instances,
false
if notpublic void genLoadId(ContextMethodBuilder mb) throws JiBXException
IComponent
String
).
genLoadId
in interface IComponent
genLoadId
in class PassThroughComponent
mb
- method builder
JiBXException
- if configuration errorpublic void setLinkages() throws JiBXException
IComponent
setLinkages
in interface IComponent
setLinkages
in class PassThroughComponent
JiBXException
- if error in configurationpublic void print(int depth)
print
in interface IComponent
print
in class PassThroughComponent
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |