public class PrecompiledBinding extends java.lang.Object implements IComponent, ITypeBinding
| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
m_attributePresenceName
Name for attribute presence test method (
null if none). |
private ClassFile |
m_class
Class handled by binding.
|
private java.lang.String |
m_completeName
Complete method name (
null if none). |
private java.lang.String |
m_completeSignature
Signature used for complete method.
|
private java.lang.String |
m_contentPresenceName
Name for content presence test method (
null if none). |
private java.lang.String |
m_factoryName
Binding factory name used for activating namespace translation on
marshalling (
null if translation not required). |
private java.lang.String |
m_marshalAttributeName
Name for marshal attribute method (
null if none). |
private java.lang.String |
m_marshalContentName
Name for marshal content method (
null if none). |
private java.lang.String |
m_marshalSignature
Signature used for marshalling (and prepare) methods.
|
private java.lang.String |
m_newInstanceName
New instance method name.
|
private java.lang.String |
m_prepareName
Prepare method name (
null if none). |
private java.lang.String |
m_unmarshalAttributeName
Name for unmarshal attribute method (
null if none). |
private java.lang.String |
m_unmarshalContentName
Name for unmarshal content method (
null if none). |
private java.lang.String |
m_unmarshalSignature
Signature used for unmarshalling (and new instance) methods.
|
private static java.lang.String |
MARSHALLING_CONTEXT |
private static java.lang.String |
MARSHALLING_CONTEXT_SIG |
private static java.lang.String |
POP_NAMESPACES_METHOD |
private static java.lang.String |
POP_NAMESPACES_SIG |
private static java.lang.String |
PRESENCE_TEST_SIG |
private static java.lang.String |
PUSH_NAMESPACES_METHOD |
private static java.lang.String |
PUSH_NAMESPACES_SIG |
private static java.lang.String |
UNMARSHALLING_CONTEXT |
private static java.lang.String |
UNMARSHALLING_CONTEXT_SIG |
| Constructor and Description |
|---|
PrecompiledBinding(int index,
java.lang.String[][] abmaps,
boolean xlated,
java.lang.String factname)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
void |
genNewInstance(ContextMethodBuilder mb)
Generate code to create new instance of object.
|
java.lang.String |
getAttributeMarshalMethod()
Get the method which marshals attributes from an instance.
|
java.lang.String |
getAttributePresentTestMethod()
Get the method which checks attributes to determine if an instance is
present.
|
java.lang.String |
getAttributeUnmarshalMethod()
Get the method which unmarshals attributes into an instance.
|
java.lang.String |
getCompleteMethod()
Get the method which handles unmarshalling completion.
|
java.lang.String |
getContentMarshalMethod()
Get the method which marshals child elements and character data content
from an instance.
|
java.lang.String |
getContentPresentTestMethod()
Get the method which checks child elements to determine if an instance is
present.
|
java.lang.String |
getContentUnmarshalMethod()
Get the method which unmarshals child elements and character data content
into an instance.
|
java.lang.String |
getCreateMethod()
Get the method which creates an instance of the bound class if one does
not already exist.
|
java.lang.String |
getPrepareMethod()
Get the method which handles preparation for marshalling an instance.
|
java.lang.String |
getType()
Get type expected by component.
|
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 MARSHALLING_CONTEXT
private static final java.lang.String UNMARSHALLING_CONTEXT
private static final java.lang.String MARSHALLING_CONTEXT_SIG
private static final java.lang.String UNMARSHALLING_CONTEXT_SIG
private static final java.lang.String PRESENCE_TEST_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 ClassFile m_class
private final java.lang.String m_newInstanceName
private final java.lang.String m_completeName
null if none).private final java.lang.String m_prepareName
null if none).private final java.lang.String m_attributePresenceName
null if none).private final java.lang.String m_contentPresenceName
null if none).private final java.lang.String m_unmarshalAttributeName
null if none).private final java.lang.String m_unmarshalContentName
null if none).private final java.lang.String m_marshalAttributeName
null if none).private final java.lang.String m_marshalContentName
null if none).private final java.lang.String m_unmarshalSignature
private final java.lang.String m_completeSignature
private final java.lang.String m_marshalSignature
private final java.lang.String m_factoryName
null if translation not required).public PrecompiledBinding(int index,
java.lang.String[][] abmaps,
boolean xlated,
java.lang.String factname)
throws JiBXException
index - abstract mapping index in bindingabmaps - abstract mapping information from bindingxlated - translated namespaces for binding flagfactname - binding factory nameJiBXException - on error loading class informationpublic boolean isOptional()
IComponentisOptional in interface IComponenttrue if optional, false if requiredpublic void genAttributeUnmarshal(ContextMethodBuilder mb) throws JiBXException
IComponentgenAttributeUnmarshal in interface IComponentmb - method builderJiBXException - if error in configurationpublic void genAttributeMarshal(ContextMethodBuilder mb) throws JiBXException
IComponentgenAttributeMarshal in interface IComponentmb - method builderJiBXException - if error in configurationpublic void genContentUnmarshal(ContextMethodBuilder mb) throws JiBXException
IComponentgenContentUnmarshal in interface IComponentmb - method builderJiBXException - if error in configurationpublic void genContentMarshal(ContextMethodBuilder mb) throws JiBXException
IComponentgenContentMarshal in interface IComponentmb - method builderJiBXException - if error in configurationpublic void genNewInstance(ContextMethodBuilder mb) throws JiBXException
IComponentgenNewInstance in interface IComponentmb - method builderJiBXException - if error in configurationpublic void genAttrPresentTest(ContextMethodBuilder mb) throws JiBXException
IComponentgenAttrPresentTest in interface IComponentmb - method builderJiBXException - if configuration errorpublic void genContentPresentTest(ContextMethodBuilder mb) throws JiBXException
IComponentgenContentPresentTest in interface IComponentmb - method builderJiBXException - if configuration errorpublic java.lang.String getType()
IComponentgetType in interface IComponentpublic boolean hasId()
IComponenthasId in interface IComponenttrue if ID value defined for instances,
false if notpublic void genLoadId(ContextMethodBuilder mb)
IComponentString).genLoadId in interface IComponentmb - method builderpublic void setLinkages()
ILinkablesetLinkages in interface ILinkablepublic NameDefinition getWrapperName()
IComponentgetWrapperName in interface IComponentnull if no wrapper elementpublic boolean hasAttribute()
IComponenthasAttribute in interface IComponenttrue if one or more attribute values defined for
containing element, false if notpublic boolean hasContent()
IComponentILinkable.setLinkages().hasContent in interface IComponenttrue if one or more content values defined
for containing element, false if notpublic java.lang.String getAttributeMarshalMethod()
throws JiBXException
ITypeBindinggetAttributeMarshalMethod in interface ITypeBindingnull if noneJiBXException - on error in code generationpublic java.lang.String getAttributePresentTestMethod()
throws JiBXException
ITypeBindingtrue if an attribute of the mapping
is found, false if not.getAttributePresentTestMethod in interface ITypeBindingnull if noneJiBXException - on error in code generationpublic java.lang.String getAttributeUnmarshalMethod()
throws JiBXException
ITypeBindinggetAttributeUnmarshalMethod in interface ITypeBindingnull if noneJiBXException - on error in code generationpublic java.lang.String getCompleteMethod()
throws JiBXException
ITypeBindinggetCompleteMethod in interface ITypeBindingnull if noneJiBXException - on error in code generationpublic java.lang.String getContentMarshalMethod()
throws JiBXException
ITypeBindinggetContentMarshalMethod in interface ITypeBindingnull if noneJiBXException - on error in code generationpublic java.lang.String getContentPresentTestMethod()
throws JiBXException
ITypeBindingtrue if an attribute of the mapping
is found, false if not.getContentPresentTestMethod in interface ITypeBindingnull if noneJiBXException - on error in code generationpublic java.lang.String getContentUnmarshalMethod()
throws JiBXException
ITypeBindinggetContentUnmarshalMethod in interface ITypeBindingnull if noneJiBXException - on error in code generationpublic java.lang.String getCreateMethod()
throws JiBXException
ITypeBindingnull that reference will
simply be returned; otherwise, a new instance will be created and
returned. This method also handles any appropriate pre-set processing for
the instance.getCreateMethod in interface ITypeBindingnull if noneJiBXException - on error in code generationpublic java.lang.String getPrepareMethod()
throws JiBXException
ITypeBindinggetPrepareMethod in interface ITypeBindingnull if noneJiBXException - on error in code generationpublic void print(int depth)
print in interface IComponent