|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jibx.binding.model.DefinitionContext
public class DefinitionContext
Definition context information. This is used to track definitions of items that can be referenced by other items. The contexts are nested, so that names not found in a context may be defined by a containing context. The access methods take this into account, automatically delegating to the containing context (if defined) when a lookup fails.
| Constructor Summary | |
|---|---|
protected |
DefinitionContext(DefinitionContext outer)
Constructor. |
| Method Summary | |
|---|---|
void |
addFormat(FormatElement def,
ValidationContext vctx)
Add format to set defined at this level. |
ValidationProblem |
addImpliedNamespace(NamespaceElement def,
ElementBase ref)
Add namespace declaration to set defined at this level. |
void |
addMappedName(NameAttributes name,
MappingElementBase def,
ValidationContext vctx)
Add mapped name to set defined at this level. |
ValidationProblem |
addNamedStructure(ContainerElementBase def)
Add named structure to set defined in this context. |
ValidationProblem |
addNamespace(NamespaceElement def)
Add namespace to set defined at this level. |
void |
addTemplate(MappingElementBase def,
ValidationContext vctx)
Add template or mapping to set defined at this level. |
NamespaceElement |
getAttributeNamespace(NameAttributes name)
Get namespace definition for attribute name. |
FormatElement |
getBestFormat(IClass clas)
Get best format definition for class. |
DefinitionContext |
getContaining()
Get containing context. |
NamespaceElement |
getElementDefaultNamespace()
Get the default namespace applied to element definitions. |
NamespaceElement |
getElementNamespace(NameAttributes name,
ValidationContext vctx)
Get namespace definition for element name. |
FormatElement |
getNamedFormat(String name)
Get named format definition. |
ContainerElementBase |
getNamedStructure(String label)
Get labeled structure definition within this context. |
TemplateElementBase |
getNamedTemplate(String name)
Get named template definition. |
NamespaceElement |
getNamespaceForPrefix(String prefix)
Get namespace for prefix. |
ArrayList |
getNamespaces()
Get the namespaces defined in this context |
FormatElement |
getSpecificFormat(String type)
Get specific format definition for type. |
TemplateElementBase |
getSpecificTemplate(String type)
Get specific template definition for type. |
boolean |
isCompatibleTemplateType(IClass clas)
Checks if a class is compatible with one or more templates. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected DefinitionContext(DefinitionContext outer)
outer - containing definition context (null if
at root of tree)| Method Detail |
|---|
public DefinitionContext getContaining()
null if at root of
tree)public NamespaceElement getElementDefaultNamespace()
null if none)public NamespaceElement getNamespaceForPrefix(String prefix)
prefix -
null if nonepublic ValidationProblem addNamespace(NamespaceElement def)
def - namespace definition element to be added (duplicates ignored)
null if no problem
public ValidationProblem addImpliedNamespace(NamespaceElement def,
ElementBase ref)
def - namespace definition to be added (duplicates ignored)ref - binding element referencing the namespace
null if no problem
public NamespaceElement getElementNamespace(NameAttributes name,
ValidationContext vctx)
name - attribute group defining namevctx - validation context in use
null if none that matchespublic NamespaceElement getAttributeNamespace(NameAttributes name)
name - attribute group defining name
null if none that matches
public void addFormat(FormatElement def,
ValidationContext vctx)
def - format definition element to be addedvctx - validation context in usepublic FormatElement getSpecificFormat(String type)
type - fully qualified class name to be converted
null if not
foundpublic FormatElement getNamedFormat(String name)
name - conversion name to be found
null
if no conversion with that namepublic FormatElement getBestFormat(IClass clas)
clas - information for target conversion class
null if no
compatible conversion defined
public void addMappedName(NameAttributes name,
MappingElementBase def,
ValidationContext vctx)
name - mapped namedef - mapping definitionvctx - validation context
public void addTemplate(MappingElementBase def,
ValidationContext vctx)
def - template definition element to be addedvctx - validation context in usepublic TemplateElementBase getSpecificTemplate(String type)
type - fully qualified class name to be converted
null if not
foundpublic TemplateElementBase getNamedTemplate(String name)
name - conversion name to be found
null if no
template with that namepublic boolean isCompatibleTemplateType(IClass clas)
clas - information for target class
true if compatible type, false if notpublic ValidationProblem addNamedStructure(ContainerElementBase def)
def - structure definition
null if no problempublic ContainerElementBase getNamedStructure(String label)
label - structure definition label
null
if not definedpublic ArrayList getNamespaces()
null if none)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||