Class QNameUtils
java.lang.Object
org.springframework.xml.namespace.QNameUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic QNamegetQNameForNode(Node node) Returns the qualified name of the given DOM Node.static QNameparseQNameString(String qNameString) Parse the given qualified name string into aQName.static QNameConvert a namespace URI and DOM or SAX qualified name to aQName.static StringtoQualifiedName(QName qName) Convert aQNameto a qualified name, as used by DOM and SAX.static booleanvalidateQName(@Nullable String text) Validates the given String as a QName.
-
Constructor Details
-
QNameUtils
public QNameUtils()
-
-
Method Details
-
validateQName
Validates the given String as a QName.- Parameters:
text- the qualified name- Returns:
trueif valid,falseotherwise
-
getQNameForNode
-
toQualifiedName
-
toQName
Convert a namespace URI and DOM or SAX qualified name to aQName. The qualified name can have the formprefix:localnameorlocalName.- Parameters:
namespaceUri- the namespace URIqualifiedName- the qualified name- Returns:
- a QName
-
parseQNameString
Parse the given qualified name string into aQName. Expects the syntaxlocalPart,{namespace}localPart, or{namespace}prefix:localPart. This format resembles thetoString()representation ofQNameitself, but allows for prefixes to be specified as well.- Returns:
- a corresponding QName instance
- Throws:
IllegalArgumentException- when the given string isnullor empty.
-