public class DirectObject extends java.lang.Object implements IComponent
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
ABSTRACTMARSHAL_METHOD |
private static java.lang.String |
ABSTRACTMARSHAL_SIGNATURE |
private static java.lang.String |
ABSTRACTMARSHALLER_INTERFACE |
private static java.lang.String |
ALIASABLE_INTERFACETYPE |
private static java.lang.String |
ANY_INIT_SIG |
private static java.lang.String |
ANY_INITCLASS_SIG |
private static java.lang.String |
GETMARSHALLER_METHOD |
private static java.lang.String |
GETMARSHALLER_SIGNATURE |
private static java.lang.String |
GETUNMARSHALLER_METHOD |
private static java.lang.String |
GETUNMARSHALLER_SIGNATURE |
private DefinitionContext |
m_defContext
Definition context for resolving names.
|
private java.lang.String |
m_factoryName
Binding factory name used for activating namespace translation on
marshalling (
null if translation not required). |
private boolean |
m_fixedName
Mapping name supplied flag.
|
private boolean |
m_isAbstract
Abstract mapping flag.
|
private java.lang.String |
m_mappingName
Name used for the mapping in binding tables.
|
private ClassFile |
m_marshaller
Marshaller class (lazy create on first use if name supplied).
|
private ClassFile |
m_marshallerBase
Marshaller base class.
|
private NameDefinition |
m_name
Element name information (
null if no bound element). |
private IContainer |
m_parent
Containing binding definition structure.
|
private ClassFile |
m_targetClass
Class handled by this binding.
|
private ClassFile |
m_unmarshaller
Unmarshaller class (lazy create on first use if name supplied).
|
private ClassFile |
m_unmarshallerBase
Unmarshaller base class.
|
private static java.lang.String |
MARSHALLER_MARSHAL_METHOD |
private static java.lang.String |
MARSHALLER_MARSHAL_SIGNATURE |
private static java.lang.String |
MARSHALONLY_INIT_SIG |
private static java.lang.String |
MARSHALONLY_INITCLASS_SIG |
private static java.lang.String |
MARSHALUNMARSHAL_INIT_SIG |
private static java.lang.String |
MARSHALUNMARSHAL_INITCLASS_SIG |
private static java.lang.String |
POP_NAMESPACES_METHOD |
private static java.lang.String |
POP_NAMESPACES_SIG |
private static java.lang.String |
PUSH_NAMESPACES_METHOD |
private static java.lang.String |
PUSH_NAMESPACES_SIG |
private static java.lang.String |
UNMARSHALLER_TESTPRESENT_METHOD |
private static java.lang.String |
UNMARSHALLER_TESTPRESENT_SIGNATURE |
private static java.lang.String |
UNMARSHALLER_UNMARSHAL_METHOD |
private static java.lang.String |
UNMARSHALLER_UNMARSHAL_SIGNATURE |
private static java.lang.String |
UNMARSHALONLY_INIT_SIG |
private static java.lang.String |
UNMARSHALONLY_INITCLASS_SIG |
Constructor and Description |
---|
DirectObject(IContainer parent,
DefinitionContext defc,
ClassFile target,
boolean abs,
ClassFile mcf,
ClassFile ucf,
java.lang.String mapname,
NameDefinition name,
java.lang.String factname)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
private void |
createSubclass(boolean out)
Create aliased subclass for marshaller or unmarshaller with element name
defined by binding.
|
void |
genAttributeMarshal(ContextMethodBuilder mb)
Generate attribute marshalling code.
|
void |
genAttributeUnmarshal(ContextMethodBuilder mb)
Generate attribute unmarshalling code.
|
void |
genAttrPresentTest(ContextMethodBuilder mb)
Generate code to test for attribute present.
|
void |
genContentMarshal(ContextMethodBuilder mb)
Generate element or text marshalling code.
|
void |
genContentPresentTest(ContextMethodBuilder mb)
Generate code to test for content present.
|
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 |
genLoadName(ContextMethodBuilder mb)
Load name used to identify mapping in binding tables.
|
void |
genMarshal(ContextMethodBuilder mb)
Generate marshalling code for this mapping.
|
void |
genNewInstance(ContextMethodBuilder mb)
Generate code to create new instance of object.
|
void |
genTestPresent(ContextMethodBuilder mb)
Generate presence test code for this mapping.
|
void |
genUnmarshal(ContextMethodBuilder mb)
Generate unmarshalling code for this mapping.
|
ClassFile |
getMarshaller()
Get marshaller class used for mapping.
|
ClassFile |
getTargetClass()
Get target class for mapping.
|
java.lang.String |
getType()
Get type expected by component.
|
ClassFile |
getUnmarshaller()
Get unmarshaller class used for mapping.
|
NameDefinition |
getWrapperName()
Get element wrapper name.
|
boolean |
hasAttribute()
Check if component defines one or more attribute values of the
containing element.
|
boolean |
hasContent()
Check if component defines one or more elements or text values as
children of the containing element.
|
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) |
void |
setLinkages()
Establish and validate linkages between binding components.
|
private static final java.lang.String GETUNMARSHALLER_METHOD
private static final java.lang.String GETUNMARSHALLER_SIGNATURE
private static final java.lang.String GETMARSHALLER_METHOD
private static final java.lang.String GETMARSHALLER_SIGNATURE
private static final java.lang.String MARSHALLER_MARSHAL_METHOD
private static final java.lang.String MARSHALLER_MARSHAL_SIGNATURE
private static final java.lang.String UNMARSHALLER_TESTPRESENT_METHOD
private static final java.lang.String UNMARSHALLER_TESTPRESENT_SIGNATURE
private static final java.lang.String UNMARSHALLER_UNMARSHAL_METHOD
private static final java.lang.String UNMARSHALLER_UNMARSHAL_SIGNATURE
private static final java.lang.String ABSTRACTMARSHALLER_INTERFACE
private static final java.lang.String ABSTRACTMARSHAL_METHOD
private static final java.lang.String ABSTRACTMARSHAL_SIGNATURE
private static final java.lang.String ALIASABLE_INTERFACETYPE
private static final java.lang.String ANY_INIT_SIG
private static final java.lang.String ANY_INITCLASS_SIG
private static final java.lang.String MARSHALUNMARSHAL_INIT_SIG
private static final java.lang.String MARSHALONLY_INIT_SIG
private static final java.lang.String UNMARSHALONLY_INIT_SIG
private static final java.lang.String MARSHALUNMARSHAL_INITCLASS_SIG
private static final java.lang.String MARSHALONLY_INITCLASS_SIG
private static final java.lang.String UNMARSHALONLY_INITCLASS_SIG
private static final java.lang.String PUSH_NAMESPACES_METHOD
private static final java.lang.String PUSH_NAMESPACES_SIG
private static final java.lang.String POP_NAMESPACES_METHOD
private static final java.lang.String POP_NAMESPACES_SIG
private final IContainer m_parent
private final DefinitionContext m_defContext
private final boolean m_isAbstract
private final NameDefinition m_name
null
if no bound element).private final ClassFile m_targetClass
private final ClassFile m_marshallerBase
private final ClassFile m_unmarshallerBase
private final boolean m_fixedName
private final java.lang.String m_factoryName
null
if translation not required).private ClassFile m_marshaller
private ClassFile m_unmarshaller
private java.lang.String m_mappingName
public DirectObject(IContainer parent, DefinitionContext defc, ClassFile target, boolean abs, ClassFile mcf, ClassFile ucf, java.lang.String mapname, NameDefinition name, java.lang.String factname) throws JiBXException
parent
- containing binding definition structuredefc
- active definitions contexttarget
- class handled by this bindingabs
- abstract mapping flagmcf
- marshaller class information (null
if input only
binding)ucf
- unmarshaller class information (null
if output
only binding)mapname
- mapping name in binding definition tables
(null
if to be constructed)name
- element name information (null
if no element
name)factname
- binding factory name for marshalling namespace
translation (null
if no namespace translation)JiBXException
- if configuration errorprivate void genLoadName(ContextMethodBuilder mb) throws JiBXException
mb
- method builderJiBXException
private void createSubclass(boolean out) throws JiBXException
out
- true
if alias needed for marshalling,
false
if for unmarshallingJiBXException
- on configuration errorpublic void genTestPresent(ContextMethodBuilder mb) throws JiBXException
mb
- method builderJiBXException
- if error in generating codepublic void genUnmarshal(ContextMethodBuilder mb) throws JiBXException
null
). The unmarshalled object (or null
in
the case of a missing optional item) is left on the stack after this
call. The calling method generally needs to cast this object reference to
the appropriate type before using it.mb
- method builderJiBXException
- if error in generating codepublic void genMarshal(ContextMethodBuilder mb) throws JiBXException
mb
- method builderJiBXException
- if error in configurationpublic ClassFile getTargetClass()
public ClassFile getMarshaller() throws JiBXException
JiBXException
- if error in transformationpublic ClassFile getUnmarshaller() throws JiBXException
JiBXException
- if error in transformationpublic boolean isOptional()
IComponent
isOptional
in interface IComponent
true
if optional, false
if requiredpublic boolean hasAttribute()
IComponent
hasAttribute
in interface IComponent
true
if one or more attribute values defined for
containing element, false
if notpublic void genAttrPresentTest(ContextMethodBuilder mb)
IComponent
genAttrPresentTest
in interface IComponent
mb
- method builderpublic void genAttributeUnmarshal(ContextMethodBuilder mb)
IComponent
genAttributeUnmarshal
in interface IComponent
mb
- method builderpublic void genAttributeMarshal(ContextMethodBuilder mb)
IComponent
genAttributeMarshal
in interface IComponent
mb
- method builderpublic boolean hasContent()
IComponent
ILinkable.setLinkages()
.hasContent
in interface IComponent
true
if one or more content values defined
for containing element, false
if notpublic void genContentPresentTest(ContextMethodBuilder mb) throws JiBXException
IComponent
genContentPresentTest
in interface IComponent
mb
- method builderJiBXException
- if configuration errorpublic void genContentUnmarshal(ContextMethodBuilder mb) throws JiBXException
IComponent
genContentUnmarshal
in interface IComponent
mb
- method builderJiBXException
- if error in configurationpublic void genContentMarshal(ContextMethodBuilder mb) throws JiBXException
IComponent
genContentMarshal
in interface IComponent
mb
- method builderJiBXException
- if error in configurationpublic void genNewInstance(ContextMethodBuilder mb)
IComponent
genNewInstance
in interface IComponent
mb
- method builderpublic java.lang.String getType()
IComponent
getType
in interface IComponent
public boolean hasId()
IComponent
hasId
in interface IComponent
true
if ID value defined for instances,
false
if notpublic void genLoadId(ContextMethodBuilder mb)
IComponent
String
).genLoadId
in interface IComponent
mb
- method builderpublic NameDefinition getWrapperName()
IComponent
getWrapperName
in interface IComponent
null
if no wrapper elementpublic void setLinkages() throws JiBXException
ILinkable
setLinkages
in interface ILinkable
JiBXException
- if error in configurationpublic void print(int depth)
print
in interface IComponent