| java.lang.Object org.jibx.binding.model.DefinitionContext
DefinitionContext | public class DefinitionContext (Code) | | 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.
author: Dennis M. Sosnoski version: 1.0 |
DefinitionContext | protected DefinitionContext(DefinitionContext outer)(Code) | | Constructor.
Parameters: outer - containing definition context (null ifat root of tree) |
addFormat | public void addFormat(FormatElement def, ValidationContext vctx)(Code) | | Add format to set defined at this level.
Parameters: def - format definition element to be added Parameters: vctx - validation context in use |
addImpliedNamespace | public ValidationProblem addImpliedNamespace(NamespaceElement def, ElementBase ref)(Code) | | Add namespace declaration to set defined at this level. This method
treats all namespaces as though they were declared with default="none".
Parameters: def - namespace definition to be added (duplicates ignored) Parameters: ref - binding element referencing the namespace problem information, or null if no problem |
addMappedName | public void addMappedName(NameAttributes name, MappingElement def, ValidationContext vctx)(Code) | | Add mapped name to set defined at this level.
Parameters: name - mapped name Parameters: def - mapping definition Parameters: vctx - validation context |
addNamedStructure | public ValidationProblem addNamedStructure(ContainerElementBase def)(Code) | | Add named structure to set defined in this context. For named structures
only the definition context associated with the binding element should be
used. This is a kludge, but will go away in 2.0.
Parameters: def - structure definition problem information, or null if no problem |
addNamespace | public ValidationProblem addNamespace(NamespaceElement def)(Code) | | Add namespace to set defined at this level.
Parameters: def - namespace definition element to be added (duplicates ignored) problem information, or null if no problem |
addTemplate | public void addTemplate(TemplateElementBase def, ValidationContext vctx)(Code) | | Add template or mapping to set defined at this level.
Parameters: def - template definition element to be added Parameters: vctx - validation context in use |
getAttributeNamespace | public NamespaceElement getAttributeNamespace(NameAttributes name)(Code) | | Get namespace definition for attribute name.
TODO: handle multiple prefixes for namespace, proper screening
Parameters: name - attribute group defining name namespace definition, or null if none that matches |
getBestFormat | public FormatElement getBestFormat(IClass clas)(Code) | | Get best format definition for class. Finds the format based on the
inheritance hierarchy for the supplied class. If a specific format for
the actual class is not found (either in this or a containing level) this
returns the most specific superclass format.
Parameters: clas - information for target conversion class conversion definition for class, or null if nocompatible conversion defined |
getContaining | public DefinitionContext getContaining()(Code) | | Get containing context.
containing context information (null if at root oftree) |
getElementNamespace | public NamespaceElement getElementNamespace(NameAttributes name)(Code) | | Get namespace definition for element name.
TODO: handle multiple prefixes for namespace, proper screening
Parameters: name - attribute group defining name namespace definition, or null if none that matches |
getIncludeCopy | DefinitionContext getIncludeCopy()(Code) | | Copy a context for use by an included binding. The duplicated context has
the same containing context as the original, and shared reference
structures for formats and templates, but only a static copy of the
namespace definitions.
context copy for included binding |
getNamedFormat | public FormatElement getNamedFormat(String name)(Code) | | Get named format definition. Finds the format with the supplied
name, checking the containing definitions if the format is not found
at this level.
Parameters: name - conversion name to be found conversion definition with specified name, or null if no conversion with that name |
getNamedStructure | public ContainerElementBase getNamedStructure(String label)(Code) | | Get labeled structure definition within this context. For named
structures only the definition context associated with the binding
element should be used. This is a kludge, but will go away in 2.0.
Parameters: label - structure definition label structure definition with specified label, or null if not defined |
getNamedTemplate | public TemplateElementBase getNamedTemplate(String name)(Code) | | Get named template definition. Finds the template with the supplied
name, checking the containing definitions if the template is not found
at this level.
TODO: Make this specific to TemplateElement in 2.0
Parameters: name - conversion name to be found template definition for class, or null if notemplate with that name |
getNamespaceForPrefix | public NamespaceElement getNamespaceForPrefix(String prefix)(Code) | | Get namespace for prefix.
Parameters: prefix - namespace definition in this context, null if none |
getNamespaces | public ArrayList getNamespaces()(Code) | | Get the namespaces defined in this context
namespace definitions (may be null if none) |
getSpecificFormat | public FormatElement getSpecificFormat(String type)(Code) | | Get specific format definition for type. Finds with an exact match
on the class name, checking the containing definitions if a format
is not found at this level.
Parameters: type - fully qualified class name to be converted conversion definition for class, or null if notfound |
getSpecificTemplate | public TemplateElementBase getSpecificTemplate(String type)(Code) | | Get specific template definition for type. Finds with an exact match
on the class name, checking the containing definitions if a template
is not found at this level.
Parameters: type - fully qualified class name to be converted template definition for type, or null if notfound |
injectNamespaces | void injectNamespaces(DefinitionContext to)(Code) | | Inject namespaces from this context into another context. This is
intended for includes, where the included binding inherits the
namespace declarations of the containing binding.
Parameters: to - |
isCompatibleTemplateType | public boolean isCompatibleTemplateType(IClass clas)(Code) | | Checks if a class is compatible with one or more templates. This checks
based on the inheritance hierarchy for the supplied class, looks for the
class or interface itself as well as any subclasses or implementations.
Parameters: clas - information for target class true if compatible type, false if not |
|
|