org.dom4j

Class Namespace

public class Namespace extends AbstractNode

Namespace is a Flyweight Namespace that can be shared amongst nodes.

Version: $Revision: 1.22 $

Author: James Strachan

Field Summary
protected static NamespaceCacheCACHE
Cache of Namespace instances
static NamespaceNO_NAMESPACE
No Namespace present
static NamespaceXML_NAMESPACE
XML Namespace
Constructor Summary
Namespace(String prefix, String uri)
DOCUMENT ME!
Method Summary
voidaccept(Visitor visitor)
StringasXML()
protected intcreateHashCode()
Factory method to create the hashcode allowing derived classes to change the behaviour
protected NodecreateXPathResult(Element parent)
booleanequals(Object object)
Checks whether this Namespace equals the given Namespace.
static Namespaceget(String prefix, String uri)
A helper method to return the Namespace instance for the given prefix and URI
static Namespaceget(String uri)
A helper method to return the Namespace instance for no prefix and the URI
shortgetNodeType()
StringgetPath(Element context)
StringgetPrefix()
DOCUMENT ME!
StringgetStringValue()
StringgetText()
StringgetUniquePath(Element context)
StringgetURI()
DOCUMENT ME!
StringgetXPathNameStep()
inthashCode()
DOCUMENT ME!
StringtoString()

Field Detail

CACHE

protected static final NamespaceCache CACHE
Cache of Namespace instances

NO_NAMESPACE

public static final Namespace NO_NAMESPACE
No Namespace present

XML_NAMESPACE

public static final Namespace XML_NAMESPACE
XML Namespace

Constructor Detail

Namespace

public Namespace(String prefix, String uri)
DOCUMENT ME!

Parameters: prefix is the prefix for this namespace uri is the URI for this namespace

Method Detail

accept

public void accept(Visitor visitor)

asXML

public String asXML()

createHashCode

protected int createHashCode()
Factory method to create the hashcode allowing derived classes to change the behaviour

Returns: DOCUMENT ME!

createXPathResult

protected Node createXPathResult(Element parent)

equals

public boolean equals(Object object)
Checks whether this Namespace equals the given Namespace. Two Namespaces are equals if their URI and prefix are equal.

Parameters: object DOCUMENT ME!

Returns: DOCUMENT ME!

get

public static Namespace get(String prefix, String uri)
A helper method to return the Namespace instance for the given prefix and URI

Parameters: prefix DOCUMENT ME! uri DOCUMENT ME!

Returns: an interned Namespace object

get

public static Namespace get(String uri)
A helper method to return the Namespace instance for no prefix and the URI

Parameters: uri DOCUMENT ME!

Returns: an interned Namespace object

getNodeType

public short getNodeType()

getPath

public String getPath(Element context)

getPrefix

public String getPrefix()
DOCUMENT ME!

Returns: the prefix for this Namespace.

getStringValue

public String getStringValue()

getText

public String getText()

getUniquePath

public String getUniquePath(Element context)

getURI

public String getURI()
DOCUMENT ME!

Returns: the URI for this Namespace.

getXPathNameStep

public String getXPathNameStep()

hashCode

public int hashCode()
DOCUMENT ME!

Returns: the hash code based on the qualified name and the URI of the namespace.

toString

public String toString()
Copyright B) 2005 MetaStuff Ltd. All Rights Reserved. Hosted by

SourceForge