Class QNameSupport
- java.lang.Object
-
- net.shibboleth.utilities.java.support.xml.QNameSupport
-
public final class QNameSupport extends Object
Set of helper methods for working with DOM QNames.
-
-
Constructor Summary
Constructors Modifier Constructor Description privateQNameSupport()Constructor.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static QNameconstructQName(String namespaceURI, String localName, String prefix)Constructs a QName.static QNameconstructQName(Element owningElement, String qname)Constructs a QName from a string (attribute or element content) value.static QNamegetNodeQName(Node domNode)Gets the QName for the given DOM node.static StringqnameToContentString(QName qname)Converts a QName into a string that can be used for attribute values or element content.
-
-
-
Method Detail
-
constructQName
@Nonnull public static QName constructQName(@Nonnull Element owningElement, @Nonnull @NotEmpty String qname)
Constructs a QName from a string (attribute or element content) value.- Parameters:
owningElement- parent DOM element of the Node which contains the QName valueqname- the QName string- Returns:
- the QName respresented by the string
-
constructQName
@Nonnull public static QName constructQName(@Nullable String namespaceURI, @Nonnull @NotEmpty String localName, @Nullable String prefix)
Constructs a QName.- Parameters:
namespaceURI- the namespace of the QNamelocalName- the local name of the QNameprefix- 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
-
-