public class NamespaceManager extends Object
XMLObject
.
Code which mutates the state of an XMLObject such that XML namespace-related data is also logically changed, should call the appropriate method, based on the type of change being made.
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_NS_TOKEN
The token used to represent the default namespace in
getNonVisibleNamespacePrefixes() . |
Constructor and Description |
---|
NamespaceManager(XMLObject owningObject)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
deregisterAttributeName(QName attributeName)
Deregister a namespace-qualified attribute name.
|
void |
deregisterAttributeValue(String attributeID)
Deregister a QName attribute value.
|
void |
deregisterContentValue()
Deregister a QName content value.
|
void |
deregisterNamespaceDeclaration(Namespace namespace)
Deregister a namespace declaration.
|
static String |
generateAttributeID(QName name)
From a QName representing a qualified attribute name, generate an attribute ID
suitable for use in
registerAttributeValue(String, QName)
and deregisterAttributeValue(String) . |
Set<Namespace> |
getAllNamespacesInSubtreeScope()
Get the set of all namespaces which are in scope within the subtree rooted
at the owning XMLObject.
|
Set<Namespace> |
getNamespaceDeclarations()
Get the set of namespace declarations registered on the owning XMLObject.
|
Set<Namespace> |
getNamespaces()
Get the set of namespaces currently in use on the owning XMLObject.
|
Set<String> |
getNonVisibleNamespacePrefixes()
Obtain the set of namespace prefixes used in a non-visible manner on owning XMLObject
and its children.
|
Set<Namespace> |
getNonVisibleNamespaces()
Obtain the set of namespaces used in a non-visible manner on owning XMLObject
and its children.
|
XMLObject |
getOwner()
Get the owning XMLObject instance.
|
void |
registerAttributeName(QName attributeName)
Register a namespace-qualified attribute name.
|
void |
registerAttributeValue(String attributeID,
QName attributeValue)
Register a QName attribute value.
|
void |
registerContentValue(QName content)
Register a QName element content value.
|
void |
registerElementName(QName name)
Register the owning XMLObject's element name.
|
void |
registerElementType(QName type)
Register the owning XMLObject's element type, if explicitly declared via an xsi:type.
|
void |
registerNamespaceDeclaration(Namespace namespace)
Register a namespace declaration.
|
public static final String DEFAULT_NS_TOKEN
getNonVisibleNamespacePrefixes()
.@Nonnull @NotEmpty public static String generateAttributeID(@Nonnull QName name)
registerAttributeValue(String, QName)
and deregisterAttributeValue(String)
.name
- attribute name as a QName@Nonnull public XMLObject getOwner()
@Nonnull public Set<Namespace> getNamespaces()
public void registerNamespaceDeclaration(@Nonnull Namespace namespace)
namespace
- the namespace to registerpublic void deregisterNamespaceDeclaration(@Nonnull Namespace namespace)
namespace
- the namespace to deregister@Nonnull public Set<Namespace> getNamespaceDeclarations()
public void registerAttributeName(@Nonnull QName attributeName)
attributeName
- the attribute name to registerpublic void deregisterAttributeName(@Nonnull QName attributeName)
attributeName
- the attribute name to deregisterpublic void registerAttributeValue(@Nonnull String attributeID, @Nonnull QName attributeValue)
attributeID
- unique identifier for the attribute within the XMLObject's content modelattributeValue
- the QName value to registerpublic void deregisterAttributeValue(@Nonnull String attributeID)
attributeID
- unique identifier for the attribute within the XMLObject's content modelpublic void registerContentValue(@Nonnull QName content)
content
- the QName value to registerpublic void deregisterContentValue()
@Nonnull public Set<String> getNonVisibleNamespacePrefixes()
The primary use case for this information is to support the inclusive prefixes information that may optionally be supplied as a part of XML exclusive canonicalization.
@Nonnull public Set<Namespace> getNonVisibleNamespaces()
The primary use case for this information is to support the inclusive prefixes information that may optionally be supplied as a part of XML exclusive canonicalization.
@Nonnull public Set<Namespace> getAllNamespacesInSubtreeScope()
public void registerElementName(@Nonnull QName name)
name
- the element name to registerCopyright © 2016. All rights reserved.