|
||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||
java.lang.Objectjavax.xml.namespace.QName
org.exist.fluent.QName
public class QName
A qualified name, consisting of a namespace and a local name.
| Constructor Summary | |
|---|---|
QName(String namespace,
String localName,
String prefix)
Create a qualified name. |
|
| Method Summary | |
|---|---|
int |
compareTo(QName o)
|
Attr |
createAttribute(Document doc)
Create an attribute in the given document whose name is this qualified name. |
Element |
createElement(Document doc)
Create an element in the given document whose tag is this qualified name. |
Attr |
getAttributeNode(Element elem)
Get the attribute with this qualified name from the given element. |
String |
getTag()
Get the XML tag for this qualified name, either prefix:localName or just localName if there is no prefix. |
boolean |
hasNamespace()
Return whether this qualified name is actually qualified by a namespace or not. |
static QName |
of(Node node)
Return the qualified name of the given node. |
static QName |
parse(String tag,
NamespaceMap namespaces)
Parse the given tag into a qualified name within the context of the given namespace bindings. |
static QName |
parse(String tag,
NamespaceMap namespaces,
String defaultNamespace)
Parse the given tag into a qualified name within the context of the given namespace bindings, overriding the default namespace binding with the given one. |
void |
setAttribute(Element elem,
String value)
Set an attribute value on the given element, where the attribute's name is this qualified name. |
| Methods inherited from class javax.xml.namespace.QName |
|---|
equals, getLocalPart, getNamespaceURI, getPrefix, hashCode, toString, valueOf |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public QName(String namespace,
String localName,
String prefix)
namespace - the namespace of the qualified name, null if nonelocalName - the local part of the qualified name, must not be null or emptyprefix - the prefix to use for the qualified name, null if default (empty) prefix| Method Detail |
|---|
public int compareTo(QName o)
compareTo in interface Comparable<QName>public boolean hasNamespace()
true if the qualified name has a namespace set, false if it's just a local namepublic Element createElement(Document doc)
createElement or createElementNS depending on whether
this name is actually qualified or not.
doc - the document to use to create the element
public Attr createAttribute(Document doc)
createAttribute or createAttributeNS depending on whether
this name is actually qualified or not.
doc - the document to use to create the attribute
public void setAttribute(Element elem,
String value)
setAttribute or setAttributeNS depending on whether
this name is actually qualified or not.
elem - the element on which to set the attributevalue - the value of the attributepublic Attr getAttributeNode(Element elem)
getAttributeNode or getAttributeNodeNS depending on whether
this name is actually qualified or not.
elem - the element to read the attribute from
public String getTag()
public static QName of(Node node)
node - the target node
public static QName parse(String tag,
NamespaceMap namespaces)
tag - the tag to parse, in standard XML formatnamespaces - the namespace bindings to use
public static QName parse(String tag,
NamespaceMap namespaces,
String defaultNamespace)
tag - the tag to parse, in standard XML formatnamespaces - the namespace bindings to usedefaultNamespace - the URI to use as the default namespace, in preference to any specified in the namespace bindings
|
||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||