org.opensaml
Class QName

java.lang.Object
  extended byorg.opensaml.QName

public class QName
extends java.lang.Object

Processes QName attribute values to determine their namespace and local name

Author:
Scott Cantor

Constructor Summary
QName(java.lang.String namespace, java.lang.String localName)
          Manual constructor for a QName object
 
Method Summary
 boolean equals(java.lang.Object obj)
          Overrides equality testing
 java.lang.String getLocalName()
          Gets the local name of the QName
static java.lang.String getNamespaceForPrefix(java.lang.String prefix, org.w3c.dom.Element e)
          Gets the XML namespace URI that is mapped to the specified prefix, in the context of the DOM element e
static java.lang.String getNamespaceForQName(java.lang.String qname, org.w3c.dom.Element e)
          Gets the XML namespace URI that is mapped to the prefix of a QName, in the context of the DOM element e
 java.lang.String getNamespaceURI()
          Gets the namespace URI of the QName
static QName getQNameAttribute(org.w3c.dom.Element e, java.lang.String namespace, java.lang.String name)
          Builds a QName from a QName-valued attribute by evaluating it
static QName getQNameTextNode(org.w3c.dom.Text t)
          Builds a QName from a QName-valued text node by evaluating it
 int hashCode()
          Overrides hash computation
 java.lang.String toString()
          Converts the QName to a useful debugging string form
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

QName

public QName(java.lang.String namespace,
             java.lang.String localName)
Manual constructor for a QName object

Parameters:
namespace - Namespace URI
localName - Local name
Method Detail

getQNameAttribute

public static QName getQNameAttribute(org.w3c.dom.Element e,
                                      java.lang.String namespace,
                                      java.lang.String name)
Builds a QName from a QName-valued attribute by evaluating it

Parameters:
e - The element containing the attribute
namespace - The namespace of the attribute
name - The local name of the attribute
Returns:
A QName containing the attribute value as a namespace/local name pair.

getQNameTextNode

public static QName getQNameTextNode(org.w3c.dom.Text t)
Builds a QName from a QName-valued text node by evaluating it

Parameters:
t - The text node containing the QName value
Returns:
A QName containing the text node value as a namespace/local name pair.

getNamespaceForQName

public static java.lang.String getNamespaceForQName(java.lang.String qname,
                                                    org.w3c.dom.Element e)
Gets the XML namespace URI that is mapped to the prefix of a QName, in the context of the DOM element e

Parameters:
qname - The QName value to map a prefix from
e - The DOM element in which to calculate the prefix binding
Returns:
The XML namespace URI mapped to qname's prefix in the context of e

getNamespaceForPrefix

public static java.lang.String getNamespaceForPrefix(java.lang.String prefix,
                                                     org.w3c.dom.Element e)
Gets the XML namespace URI that is mapped to the specified prefix, in the context of the DOM element e

Parameters:
prefix - The namespace prefix to map
e - The DOM element in which to calculate the prefix binding
Returns:
The XML namespace URI mapped to prefix in the context of e

getNamespaceURI

public java.lang.String getNamespaceURI()
Gets the namespace URI of the QName

Returns:
The namespace URI

getLocalName

public java.lang.String getLocalName()
Gets the local name of the QName

Returns:
The local name

equals

public boolean equals(java.lang.Object obj)
Overrides equality testing

Parameters:
obj - The object to compare
Returns:
true iff both the namespace URI and local names match

hashCode

public int hashCode()
Overrides hash computation

Returns:
The sum of the hashes of the namespace URI and local name

toString

public java.lang.String toString()
Converts the QName to a useful debugging string form

Returns:
The namespace URI in braces, then a colon, then the local name


Copyright ? 2002 UCAID. All Rights Reserved.