public class DefinitionContext extends Object
| Constructor and Description |
|---|
DefinitionContext(IContainer contain)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addConversion(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(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(QName name,
StringConversion conv)
Sets a conversion definition by both type and name.
|
void |
setLinkages()
Set linkages between binding components.
|
void |
setNamedConversion(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 JiBXException
def - mapping definition to be addedJiBXException - on mapping definition conflictpublic void addNamedStructure(String name, IComponent comp) throws JiBXException
name - component name to be setcomp - named componentJiBXException - 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 JiBXException
uri - namespace URI to be foundattr - flag for attribute nameJiBXException - 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 JiBXException
name - component name to be foundJiBXException - 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(QName name)
name - conversion name to be foundpublic void addConversion(QName name, StringConversion conv) throws JiBXException
name - format name for this conversionconv - conversion definition for classJiBXException - if duplicate conversion definitionpublic void setConversion(StringConversion conv) throws JiBXException
conv - conversion definition for classJiBXException - if duplicate conversion definitionpublic void setNamedConversion(QName name, StringConversion conv) throws JiBXException
name - format name for this conversionconv - conversion definition for classJiBXException - if duplicate conversion definitionpublic void setDefaultConversion(QName name, StringConversion conv) throws JiBXException
name - format name for this conversionconv - conversion definition for classJiBXException - 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 JiBXException
verbose - flag for verbose outputforce - create marshaller/unmarshaller even for abstract non-base
mappings flagJiBXException - if error in transformationpublic void linkMappings()
throws JiBXException
JiBXException - if error in linkingpublic void setLinkages()
throws JiBXException
JiBXException - if error in configurationpublic void print(int depth)
Copyright © 2005-2013 jibx.org. All Rights Reserved.