public final class NamespaceHelper extends Object
| Modifier and Type | Method and Description |
|---|---|
static QName |
createQName(Element e,
String value,
String defaultNamespace) |
static QName |
createQName(NamespaceContext nc,
String value) |
static String |
getPrefix(Element element,
String namespaceURI) |
static void |
getPrefixes(Element element,
String namespaceURI,
List<String> prefixes) |
static String |
getUniquePrefix(Element element,
String namespaceURI)
Create a unique namespace uri/prefix combination.
|
static String |
getUniquePrefix(javax.xml.stream.XMLStreamWriter writer,
String namespaceURI,
boolean declare)
Create a unique namespace uri/prefix combination.
|
static String |
getUniquePrefix(javax.xml.stream.XMLStreamWriter writer,
String namespaceURI,
String preferred,
boolean declare)
Make a unique prefix.
|
static String |
makeNamespaceFromClassName(String className,
String protocol)
Generates the name of a XML namespace from a given class name and
protocol.
|
static String |
makePackageName(String namespace)
Method makePackageName
|
static QName |
readQName(javax.xml.stream.XMLStreamReader reader)
Reads a QName from the element text.
|
public static String getUniquePrefix(Element element, String namespaceURI)
nsUri - public static void getPrefixes(Element element, String namespaceURI, List<String> prefixes)
public static String getUniquePrefix(javax.xml.stream.XMLStreamWriter writer, String namespaceURI, boolean declare) throws javax.xml.stream.XMLStreamException
nsUri - javax.xml.stream.XMLStreamExceptionpublic static String getUniquePrefix(javax.xml.stream.XMLStreamWriter writer, String namespaceURI, String preferred, boolean declare) throws javax.xml.stream.XMLStreamException
writer - target writer.namespaceURI - namespacepreferred - if there's a proposed prefix (e.g. xsi), here it is.declare - whether to declare to the stream.javax.xml.stream.XMLStreamExceptionpublic static String makeNamespaceFromClassName(String className, String protocol)
protocol://domain, where protocol is the
given protocol, and domain the inversed package name of
the given class name. For instance, if the given class name is
org.codehaus.xfire.services.Echo, and the protocol is
http, the resulting namespace would be
http://services.xfire.codehaus.org.className - the class nameprotocol - the protocol (eg. http)public static String makePackageName(String namespace)
namespace - public static QName readQName(javax.xml.stream.XMLStreamReader reader) throws javax.xml.stream.XMLStreamException
reader - javax.xml.stream.XMLStreamExceptionpublic static QName createQName(NamespaceContext nc, String value)
Apache CXF