Package org.dom4j
Class QName
- java.lang.Object
-
- org.dom4j.QName
-
- All Implemented Interfaces:
java.io.Serializable
public class QName extends java.lang.Object implements java.io.Serializable
QName
represents a qualified name value of an XML element or attribute. It consists of a local name and aNamespace
instance. This object is immutable.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private DocumentFactory
documentFactory
The document factory used for this QName if specified or nullprivate int
hashCode
A cached version of the hashcode for efficiencyprivate java.lang.String
name
The local name of the element or attributeprivate Namespace
namespace
The Namespace of this element or attributeprivate java.lang.String
qualifiedName
The qualified name of the element or attributeprivate static SingletonStrategy<QNameCache>
singleton
The Singleton instance
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object object)
static QName
get(java.lang.String name)
static QName
get(java.lang.String qualifiedName, java.lang.String uri)
static QName
get(java.lang.String name, java.lang.String prefix, java.lang.String uri)
static QName
get(java.lang.String name, Namespace namespace)
static QName
get(java.lang.String localName, Namespace namespace, java.lang.String qualifiedName)
private static QNameCache
getCache()
DocumentFactory
getDocumentFactory()
DOCUMENT ME!java.lang.String
getName()
DOCUMENT ME!Namespace
getNamespace()
DOCUMENT ME!java.lang.String
getNamespacePrefix()
DOCUMENT ME!java.lang.String
getNamespaceURI()
DOCUMENT ME!java.lang.String
getQualifiedName()
DOCUMENT ME!int
hashCode()
DOCUMENT ME!private void
readObject(java.io.ObjectInputStream in)
void
setDocumentFactory(DocumentFactory documentFactory)
java.lang.String
toString()
private void
writeObject(java.io.ObjectOutputStream out)
-
-
-
Field Detail
-
singleton
private static SingletonStrategy<QNameCache> singleton
The Singleton instance
-
name
private java.lang.String name
The local name of the element or attribute
-
qualifiedName
private java.lang.String qualifiedName
The qualified name of the element or attribute
-
namespace
private transient Namespace namespace
The Namespace of this element or attribute
-
hashCode
private int hashCode
A cached version of the hashcode for efficiency
-
documentFactory
private DocumentFactory documentFactory
The document factory used for this QName if specified or null
-
-
Method Detail
-
get
public static QName get(java.lang.String name)
-
get
public static QName get(java.lang.String name, java.lang.String prefix, java.lang.String uri)
-
get
public static QName get(java.lang.String qualifiedName, java.lang.String uri)
-
get
public static QName get(java.lang.String localName, Namespace namespace, java.lang.String qualifiedName)
-
getName
public java.lang.String getName()
DOCUMENT ME!- Returns:
- the local name
-
getQualifiedName
public java.lang.String getQualifiedName()
DOCUMENT ME!- Returns:
- the qualified name in the format
prefix:localName
-
getNamespace
public Namespace getNamespace()
DOCUMENT ME!- Returns:
- the namespace of this QName
-
getNamespacePrefix
public java.lang.String getNamespacePrefix()
DOCUMENT ME!- Returns:
- the namespace URI of this QName
-
getNamespaceURI
public java.lang.String getNamespaceURI()
DOCUMENT ME!- Returns:
- the namespace URI of this QName
-
hashCode
public int hashCode()
DOCUMENT ME!- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- the hash code based on the qualified name and the URI of the namespace.
-
equals
public boolean equals(java.lang.Object object)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getDocumentFactory
public DocumentFactory getDocumentFactory()
DOCUMENT ME!- Returns:
- the factory that should be used for Elements of this QName
-
setDocumentFactory
public void setDocumentFactory(DocumentFactory documentFactory)
-
writeObject
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException
- Throws:
java.io.IOException
-
readObject
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException
- Throws:
java.io.IOException
java.lang.ClassNotFoundException
-
getCache
private static QNameCache getCache()
-
-