public class BindingHolder
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private BindingElement |
m_binding
Actual binding definition.
|
private boolean |
m_elementDefault
Namespace used by default for elements flag.
|
private java.lang.String |
m_fileName
Name for file to be written from binding.
|
private boolean |
m_finished
Binding finalized flag.
|
private LazyList |
m_mappings
List of mapping definitions in binding.
|
private java.lang.String |
m_namespace
Namespace URI associated with this binding (
null if no-namespace binding). |
private boolean |
m_namespaceUsed
Binding namespace used for element or attribute flag.
|
private BindingOrganizer |
m_organizer
Organizer managing this holder.
|
private java.lang.String |
m_prefix
Prefix to be used for this namespace (
null if unspecified). |
private boolean |
m_pullUpNamespaces
Pull namespaces used in element or attribute names up to root binding flag (set when a type reference to this
binding is seen).
|
private InsertionOrderedSet |
m_referencedNamespaces
Set of namespaces referenced in qualified names in this bindings.
|
private InsertionOrderedSet |
m_usedNamespaces
Set of namespaces used in element or attribute names in binding.
|
Constructor and Description |
---|
BindingHolder(java.lang.String uri,
boolean dflt,
BindingOrganizer dir)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addFormat(FormatElement format)
Add a format definition to the binding.
|
void |
addMapping(MappingElementBase mapping)
Add a mapping definition to the binding.
|
void |
addNamespaceUsage(java.lang.String uri)
Add usage of namespace for an element or attribute name in binding.
|
void |
addTypeNameReference(java.lang.String uri,
java.lang.Object obj)
Add reference from this binding to a type name defined in the same or another binding.
|
private void |
checkModifiable()
Internal check method to verify that the binding is still modifiable.
|
(package private) void |
finish(java.util.Collection formats,
java.util.Collection includes,
java.util.Set outernss,
java.util.Map nsdfltpref,
java.util.Map nsfrcdpref)
Finishes building the binding.
|
(package private) void |
forcePullUpNamespaces()
Force namespaces to be pulled up to the root binding.
|
BindingElement |
getBinding()
Get the binding element.
|
java.lang.String |
getElementDefaultNamespace()
Get default namespace URI for elements defined in this binding.
|
java.lang.String |
getFileName()
Get the file name to be used for this file.
|
int |
getMappingCount()
Get the number of mapping definitions present in this binding.
|
java.lang.String |
getNamespace()
Get namespace URI associated with this binding.
|
java.lang.String |
getPrefix()
Get namespace prefix for this binding.
|
(package private) java.util.Set |
getReferencedNamespaces()
Get a set of all the namespace URIs referenced by a qualified name in this binding.
|
BindingHolder |
getRequiredBinding(java.lang.Object obj)
Get the binding associated with a particular control object.
|
(package private) java.util.Set |
getUsedNamespaces()
Get a set of all the namespace URIs used by element or attributes names in this binding.
|
(package private) boolean |
isBindingNamespaceUsed()
Check if the namespace associated with this binding is actually used by any element or attribute definitions in
the binding.
|
(package private) boolean |
isNamespaceElementDefault()
Check if the namespace associated with this binding should be used as the default for definitions in the binding.
|
(package private) boolean |
isPullUpNamespaces()
Check if used namespaces need to be pulled up to the root binding.
|
java.util.Iterator |
iterateMappings()
Get the number of mapping definitions present in this binding.
|
void |
setBinding(BindingElement bind)
Set the binding element.
|
void |
setFileName(java.lang.String name)
Set the file name to be used for this file.
|
(package private) void |
setPrefix(java.lang.String prefix)
Set namespace prefix for this binding.
|
private final BindingOrganizer m_organizer
private final java.lang.String m_namespace
null
if no-namespace binding).private final boolean m_elementDefault
private final InsertionOrderedSet m_referencedNamespaces
private final InsertionOrderedSet m_usedNamespaces
private java.lang.String m_prefix
null
if unspecified).private BindingElement m_binding
private boolean m_pullUpNamespaces
private boolean m_namespaceUsed
private boolean m_finished
private java.lang.String m_fileName
private final LazyList m_mappings
public BindingHolder(java.lang.String uri, boolean dflt, BindingOrganizer dir)
uri
- (null
if no-namespace binding)dflt
- namespace is default for elements flagdir
- directory managing this holderpublic java.lang.String getNamespace()
null
if no-namespace)public java.lang.String getPrefix()
null
if not specified)void setPrefix(java.lang.String prefix)
prefix
- (null
if not specified)public java.lang.String getElementDefaultNamespace()
null
if no-namespace)public BindingElement getBinding()
public void setBinding(BindingElement bind)
bind
- public void addFormat(FormatElement format)
format
- public void addNamespaceUsage(java.lang.String uri)
uri
- referenced namespace URI (null
if no-namespace)public void addTypeNameReference(java.lang.String uri, java.lang.Object obj)
uri
- namespace URI for type nameobj
- object associated with referenced bindingprivate void checkModifiable()
public java.lang.String getFileName()
null
if not set)public void setFileName(java.lang.String name)
name
- public void addMapping(MappingElementBase mapping)
mapping
- public int getMappingCount()
public java.util.Iterator iterateMappings()
public BindingHolder getRequiredBinding(java.lang.Object obj)
obj
- object associated with binding (can be namespace URI, if only one binding per namespace)java.util.Set getReferencedNamespaces()
java.util.Set getUsedNamespaces()
void forcePullUpNamespaces()
boolean isPullUpNamespaces()
boolean isNamespaceElementDefault()
boolean isBindingNamespaceUsed()
void finish(java.util.Collection formats, java.util.Collection includes, java.util.Set outernss, java.util.Map nsdfltpref, java.util.Map nsfrcdpref)
formats
- format elements to be used in bindingincludes
- include elements to be used in bindingouternss
- namespaces inherited by this bindingnsdfltpref
- map from namespace URI to default prefix when used in a namespace declaration within the
binding (null
values for namespace used as the default)nsfrcdpref
- map from namespace URI to prefix when used in a binding namespace definition (prefix must be
non-null
and non-empty)