public class DefinitionContext extends Object
| Constructor and Description |
|---|
DefinitionContext(IContainer contain)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addConversion(org.jibx.runtime.QName name,
StringConversion conv)
Add named conversion.
|
void |
addImpliedNamespace(NamespaceDefinition def)
Add namespace declaration to set defined at this level.
|
void |
addMapping(IMapping def)
Add class mapping to set defined at this level.
|
void |
addNamedStructure(String name,
IComponent comp)
Add named structure component to set defined at this level.
|
void |
addNamespace(NamespaceDefinition def)
Add namespace to set defined at this level.
|
void |
generateCode(boolean verbose,
boolean force)
Generate code.
|
void |
genLoadNamespaces(MethodBuilder mb)
Generate code for loading namespace index and URI arrays.
|
IMapping |
getClassMapping(String name)
Get mapping definition for class.
|
StringConversion |
getConversion(ClassFile clas)
Get conversion definition for class.
|
int |
getDefaultIndex(boolean attr)
Get the default namespace index for a contained name.
|
String |
getDefaultURI(boolean attr)
Get the default namespace URI for a contained name.
|
IMapping |
getMappingAtLevel(String name)
Get mapping definition for class if defined at this level.
|
ArrayList |
getMappings()
Get mapping definitions at level.
|
StringConversion |
getNamedConversion(org.jibx.runtime.QName name)
Get named conversion definition.
|
IComponent |
getNamedStructure(String name)
Get nested structure by name.
|
int |
getNamespaceIndex(String uri,
boolean attr)
Get namespace index for a given URI.
|
ArrayList |
getNamespaces()
Get the namespaces defined in this context
|
StringConversion |
getSpecificConversion(String name)
Get specific conversion definition for type.
|
boolean |
hasNamespace()
Check if one or more namespaces are defined in this context.
|
void |
linkMappings()
Links extension mappings to their base mappings.
|
void |
print(int depth) |
void |
setConversion(StringConversion conv)
Set specific conversion definition for type.
|
void |
setDefaultConversion(org.jibx.runtime.QName name,
StringConversion conv)
Sets a conversion definition by both type and name.
|
void |
setLinkages()
Set linkages between binding components.
|
void |
setNamedConversion(org.jibx.runtime.QName name,
StringConversion conv)
Sets a named conversion definition.
|
public DefinitionContext(IContainer contain)
contain - containing binding definition componentpublic void addNamespace(NamespaceDefinition def)
def - namespace definition to be added (duplicates ignored)public void addImpliedNamespace(NamespaceDefinition def)
def - namespace definition to be added (duplicates ignored)public void addMapping(IMapping def) throws org.jibx.runtime.JiBXException
def - mapping definition to be addedorg.jibx.runtime.JiBXException - on mapping definition conflictpublic void addNamedStructure(String name, IComponent comp) throws org.jibx.runtime.JiBXException
name - component name to be setcomp - named componentorg.jibx.runtime.JiBXException - on mapping definition conflictpublic String getDefaultURI(boolean attr)
attr - flag for attribute namenull if nonepublic int getDefaultIndex(boolean attr)
attr - flag for attribute namepublic int getNamespaceIndex(String uri, boolean attr) throws org.jibx.runtime.JiBXException
uri - namespace URI to be foundattr - flag for attribute nameorg.jibx.runtime.JiBXException - if URI not defined or not usablepublic IMapping getMappingAtLevel(String name)
name - fully qualified class namenull if not definedpublic IMapping getClassMapping(String name)
name - fully qualified class namenull if not definedpublic IComponent getNamedStructure(String name) throws org.jibx.runtime.JiBXException
name - component name to be foundorg.jibx.runtime.JiBXException - if name not definedpublic ArrayList getMappings()
null if none defined at levelpublic StringConversion getSpecificConversion(String name)
name - fully qualified class name to be convertednull if not
foundpublic StringConversion getConversion(ClassFile clas)
clas - information for target conversion classpublic StringConversion getNamedConversion(org.jibx.runtime.QName name)
name - conversion name to be foundpublic void addConversion(org.jibx.runtime.QName name,
StringConversion conv)
throws org.jibx.runtime.JiBXException
name - format name for this conversionconv - conversion definition for classorg.jibx.runtime.JiBXException - if duplicate conversion definitionpublic void setConversion(StringConversion conv) throws org.jibx.runtime.JiBXException
conv - conversion definition for classorg.jibx.runtime.JiBXException - if duplicate conversion definitionpublic void setNamedConversion(org.jibx.runtime.QName name,
StringConversion conv)
throws org.jibx.runtime.JiBXException
name - format name for this conversionconv - conversion definition for classorg.jibx.runtime.JiBXException - if duplicate conversion definitionpublic void setDefaultConversion(org.jibx.runtime.QName name,
StringConversion conv)
throws org.jibx.runtime.JiBXException
name - format name for this conversionconv - conversion definition for classorg.jibx.runtime.JiBXException - if duplicate conversion definitionpublic boolean hasNamespace()
true if namespaces are defined, false
if notpublic ArrayList getNamespaces()
null if none)public void genLoadNamespaces(MethodBuilder mb)
mb - method builder for generated codepublic void generateCode(boolean verbose,
boolean force)
throws org.jibx.runtime.JiBXException
verbose - flag for verbose outputforce - create marshaller/unmarshaller even for abstract non-base
mappings flagorg.jibx.runtime.JiBXException - if error in transformationpublic void linkMappings()
throws org.jibx.runtime.JiBXException
org.jibx.runtime.JiBXException - if error in linkingpublic void setLinkages()
throws org.jibx.runtime.JiBXException
org.jibx.runtime.JiBXException - if error in configurationpublic void print(int depth)
Copyright © 2005–2016 jibx.org. All rights reserved.