XMLTooling-J 1.3.2-redhat-4

org.opensaml.xml
Class NamespaceManager

java.lang.Object
  extended by org.opensaml.xml.NamespaceManager

public class NamespaceManager
extends Object

A class which is responsible for managing XML namespace-related data for an 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.


Field Summary
static String DEFAULT_NS_TOKEN
          The token used to represent the default namespace in getNonVisibleNamespacePrefixes().
 
Constructor Summary
NamespaceManager(XMLObject owningObject)
          Constructor.
 
Method Summary
 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 deregisterNamespace(Namespace namespace)
          Deregister usage of a namespace in some indeterminate fashion.
 void deregisterNamespaceDeclaration(Namespace namespace)
          Deregister a namespace declaration.
static String generateAttributeID(QName name)
          From an 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> 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 registerNamespace(Namespace namespace)
          Register usage of a namespace in some indeterminate fashion.
 void registerNamespaceDeclaration(Namespace namespace)
          Register a namespace declaration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_NS_TOKEN

public static final String DEFAULT_NS_TOKEN
The token used to represent the default namespace in getNonVisibleNamespacePrefixes().

See Also:
Constant Field Values
Constructor Detail

NamespaceManager

public NamespaceManager(XMLObject owningObject)
Constructor.

Parameters:
owningObject - the XMLObject whose namespace info is to be managed
Method Detail

generateAttributeID

public static String generateAttributeID(QName name)
From an QName representing a qualified attribute name, generate an attribute ID suitable for use in registerAttributeValue(String, QName) and deregisterAttributeValue(String).

Parameters:
name - attribute name as a QName
Returns:
a string attribute ID

getOwner

public XMLObject getOwner()
Get the owning XMLObject instance.

Returns:
the owning XMLObject

getNamespaces

public Set<Namespace> getNamespaces()
Get the set of namespaces currently in use on the owning XMLObject.

Returns:
the set of namespaces

registerNamespace

public void registerNamespace(Namespace namespace)
Register usage of a namespace in some indeterminate fashion.

Other methods which indicate specific usage should be preferred over this one. This method exists primarily for backward-compatibility support for XMLObject.addNamespace(Namespace).

Parameters:
namespace - namespace to register

deregisterNamespace

public void deregisterNamespace(Namespace namespace)
Deregister usage of a namespace in some indeterminate fashion.

Other methods which indicate specific usage should be preferred over this one. This method exists primarily for backward-compatibility support for XMLObject.removeNamespace(Namespace).

Parameters:
namespace - namespace to deregister

registerNamespaceDeclaration

public void registerNamespaceDeclaration(Namespace namespace)
Register a namespace declaration.

Parameters:
namespace - the namespace to register

deregisterNamespaceDeclaration

public void deregisterNamespaceDeclaration(Namespace namespace)
Deregister a namespace declaration.

Parameters:
namespace - the namespace to deregister

registerAttributeName

public void registerAttributeName(QName attributeName)
Register a namespace-qualified attribute name.

Parameters:
attributeName - the attribute name to register

deregisterAttributeName

public void deregisterAttributeName(QName attributeName)
Deregister a namespace-qualified attribute name.

Parameters:
attributeName - the attribute name to deregister

registerAttributeValue

public void registerAttributeValue(String attributeID,
                                   QName attributeValue)
Register a QName attribute value.

Parameters:
attributeID - unique identifier for the attribute within the XMLObject's content model
attributeValue - the QName value to register

deregisterAttributeValue

public void deregisterAttributeValue(String attributeID)
Deregister a QName attribute value.

Parameters:
attributeID - unique identifier for the attribute within the XMLObject's content model

registerContentValue

public void registerContentValue(QName content)
Register a QName element content value.

Parameters:
content - the QName value to register

deregisterContentValue

public void deregisterContentValue()
Deregister a QName content value.


getNonVisibleNamespacePrefixes

public Set<String> getNonVisibleNamespacePrefixes()
Obtain the set of namespace prefixes used in a non-visible manner on owning XMLObject and its children.

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.

Returns:
the set of non-visibly used namespace prefixes

getNonVisibleNamespaces

public Set<Namespace> getNonVisibleNamespaces()
Obtain the set of namespaces used in a non-visible manner on owning XMLObject and its children.

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.

The Namespace instances themselves will be copied before being returned, so modifications to them do not affect the actual Namespace instances in the underlying tree. The original alwaysDeclare property is not preserved.

Returns:
the set of non-visibly used namespaces

getAllNamespacesInSubtreeScope

public Set<Namespace> getAllNamespacesInSubtreeScope()
Get the set of all namespaces which are in scope within the subtree rooted at the owning XMLObject.

The Namespace instances themselves will be copied before being returned, so modifications to them do not affect the actual Namespace instances in the underlying tree. The original alwaysDeclare property is not preserved.

Returns:
set of all namespaces in scope for the owning object

registerElementName

public void registerElementName(QName name)
Register the owning XMLObject's element name.

Parameters:
name - the element name to register

registerElementType

public void registerElementType(QName type)
Register the owning XMLObject's element type, if explicitly declared via an xsi:type.

Parameters:
type - the element type to register

XMLTooling-J 1.3.2-redhat-4

Copyright © 2006-2013 Internet2. All Rights Reserved.