Class QNameUtils
java.lang.Object
org.springframework.xml.namespace.QNameUtils
Helper class for using 
QName.- Since:
- 1.0.0
- Author:
- Arjen Poutsma
- See Also:
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic QNamecreateQName(String namespaceUri, String localPart, String prefix) Deprecated.static StringDeprecated.in favor ofQName.getPrefix()static 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(String text) Validates the given String as a QName
- 
Constructor Details- 
QNameUtilspublic QNameUtils()
 
- 
- 
Method Details- 
createQNameDeprecated.in favor ofQName(String, String, String)Creates a newQNamewith the given parameters. Sets the prefix if possible, i.e. if theQName(String, String, String)constructor can be found. If this constructor is not available (as is the case on older implementations of JAX-RPC), the prefix is ignored.- Parameters:
- namespaceUri- namespace URI of the- QName
- localPart- local part of the- QName
- prefix- prefix of the- QName. May be ignored.
- Returns:
- the created QName
- See Also:
 
- 
getPrefixDeprecated.in favor ofQName.getPrefix()Returns the prefix of the givenQName. Returns the prefix if available, i.e. if theQName.getPrefix()method can be found. If this method is not available (as is the case on older implementations of JAX-RPC), an empty string is returned.- Parameters:
- qName- the- QNameto return the prefix from
- Returns:
- the prefix, if available, or an empty string
- See Also:
 
- 
validateQNameValidates the given String as a QName- Parameters:
- text- the qualified name
- Returns:
- trueif valid,- falseotherwise
 
- 
getQNameForNodeReturns the qualified name of the given DOM Node.- Parameters:
- node- the node
- Returns:
- the qualified name of the node
 
- 
toQualifiedNameConvert aQNameto a qualified name, as used by DOM and SAX. The returned string has a format ofprefix:localNameif the prefix is set, or justlocalNameif not.- Parameters:
- qName- the- QName
- Returns:
- the qualified name
 
- 
toQNameConvert a namespace URI and DOM or SAX qualified name to aQName. The qualified name can have the formprefix:localnameorlocalName.- Parameters:
- namespaceUri- the namespace URI
- qualifiedName- the qualified name
- Returns:
- a QName
 
- 
parseQNameStringParse 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 is- nullor empty.
 
 
- 
QName(String, String, String)