net.shibboleth.utilities.java.support.xml
Class QNameSupport

java.lang.Object
  extended by net.shibboleth.utilities.java.support.xml.QNameSupport

public final class QNameSupport
extends Object

Set of helper methods for working with DOM QNames.


Constructor Summary
private QNameSupport()
          Constructor.
 
Method Summary
static QName constructQName(Element owningElement, String qname)
          Constructs a QName from a string (attribute element content) value.
static QName constructQName(String namespaceURI, String localName, String prefix)
          Constructs a QName.
static QName getNodeQName(Node domNode)
          Gets the QName for the given DOM node.
static String qnameToContentString(QName qname)
          Converts a QName into a string that can be used for attribute values or element content.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QNameSupport

private QNameSupport()
Constructor.

Method Detail

constructQName

@Nonnull
public static QName constructQName(@Nonnull
                                           Element owningElement,
                                           @Nonnull
                                           String qname)
Constructs a QName from a string (attribute element content) value.

Parameters:
qname - the QName string
owningElement - parent DOM element of the Node which contains the QName value
Returns:
the QName respresented by the string

constructQName

@Nonnull
public static QName constructQName(@Nullable
                                           String namespaceURI,
                                           @Nonnull
                                           String localName,
                                           @Nullable
                                           String prefix)
Constructs a QName.

Parameters:
namespaceURI - the namespace of the QName
localName - the local name of the QName
prefix - the prefix of the QName, may be null
Returns:
the QName

getNodeQName

@Nullable
public static QName getNodeQName(@Nullable
                                          Node domNode)
Gets the QName for the given DOM node.

Parameters:
domNode - the DOM node
Returns:
the QName for the element or null if the element was null

qnameToContentString

@Nonnull
public static String qnameToContentString(@Nonnull
                                                  QName qname)
Converts a QName into a string that can be used for attribute values or element content.

Parameters:
qname - the QName to convert to a string
Returns:
the string value of the QName


Copyright © 1999-2012. All Rights Reserved.