|
Spring Web Services Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.xml.namespace.QNameUtils
public abstract class QNameUtils
Helper class for using QName
.
QName
Constructor Summary | |
---|---|
QNameUtils()
|
Method Summary | |
---|---|
static QName |
createQName(String namespaceUri,
String localPart,
String prefix)
Creates a new QName with the given parameters. |
static String |
getPrefix(QName qName)
Returns the prefix of the given QName . |
static QName |
getQNameForNode(Node node)
Returns the qualified name of the given DOM Node. |
static QName |
parseQNameString(String qNameString)
Parse the given qualified name string into a QName . |
static QName |
toQName(String namespaceUri,
String qualifiedName)
Convert a namespace URI and DOM or SAX qualified name to a QName . |
static String |
toQualifiedName(QName qName)
Convert a QName to a qualified name, as used by DOM and SAX. |
static boolean |
validateQName(String text)
Validates the given String as a QName |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public QNameUtils()
Method Detail |
---|
public static QName createQName(String namespaceUri, String localPart, String prefix)
QName
with the given parameters. Sets the prefix if possible, i.e. if the
QName(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.
namespaceUri
- namespace URI of the QName
localPart
- local part of the QName
prefix
- prefix of the QName
. May be ignored.
QName
QName.QName(String,String,String)
public static String getPrefix(QName qName)
QName
. Returns the prefix if available, i.e. if the
QName.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.
qName
- the QName
to return the prefix from
QName.getPrefix()
public static boolean validateQName(String text)
text
- the qualified name
true
if valid, false
otherwisepublic static QName getQNameForNode(Node node)
node
- the node
public static String toQualifiedName(QName qName)
QName
to a qualified name, as used by DOM and SAX. The returned string has a format of
prefix:localName
if the prefix is set, or just localName
if not.
qName
- the QName
public static QName toQName(String namespaceUri, String qualifiedName)
QName
. The qualified name can have the
form prefix:localname
or localName
.
namespaceUri
- the namespace URIqualifiedName
- the qualified name
public static QName parseQNameString(String qNameString)
QName
. Expects the syntax localPart
,
{namespace}localPart
, or {namespace}prefix:localPart
. This format resembles the
toString()
representation of QName
itself, but allows for prefixes to be specified as
well.
IllegalArgumentException
- when the given string is null
or empty.
|
Spring Web Services Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |