org.apache.xerces.xni

Class QName

public class QName extends Object implements Cloneable

A structure that holds the components of an XML Namespaces qualified name.

To be used correctly, the strings must be identical references for equal strings. Within the parser, these values are considered symbols and should always be retrieved from the SymbolTable.

Version: $Id: QName.java,v 1.8 2004/10/03 21:53:25 mrglavas Exp $

Author: Andy Clark, IBM

See Also: org.apache.xerces.util.SymbolTable

Field Summary
Stringlocalpart
The qname localpart.
Stringprefix
The qname prefix.
Stringrawname
The qname rawname.
Stringuri
The URI to which the qname prefix is bound.
Constructor Summary
QName()
Default constructor.
QName(String prefix, String localpart, String rawname, String uri)
Constructs a QName with the specified values.
QName(QName qname)
Constructs a copy of the specified QName.
Method Summary
voidclear()
Clears the values of the qname components.
Objectclone()
Returns a clone of this object.
booleanequals(Object object)
Returns true if the two objects are equal.
inthashCode()
Returns the hashcode for this object.
voidsetValues(QName qname)
Convenience method to set the values of the qname components.
voidsetValues(String prefix, String localpart, String rawname, String uri)
Convenience method to set the values of the qname components.
StringtoString()
Returns a string representation of this object.

Field Detail

localpart

public String localpart
The qname localpart. For example, the localpart for the qname "a:foo" is "foo".

prefix

public String prefix
The qname prefix. For example, the prefix for the qname "a:foo" is "a".

rawname

public String rawname
The qname rawname. For example, the rawname for the qname "a:foo" is "a:foo".

uri

public String uri
The URI to which the qname prefix is bound. This binding must be performed by a XML Namespaces aware processor.

Constructor Detail

QName

public QName()
Default constructor.

QName

public QName(String prefix, String localpart, String rawname, String uri)
Constructs a QName with the specified values.

QName

public QName(QName qname)
Constructs a copy of the specified QName.

Method Detail

clear

public void clear()
Clears the values of the qname components.

clone

public Object clone()
Returns a clone of this object.

equals

public boolean equals(Object object)
Returns true if the two objects are equal.

hashCode

public int hashCode()
Returns the hashcode for this object.

setValues

public void setValues(QName qname)
Convenience method to set the values of the qname components.

Parameters: qname The qualified name to be copied.

setValues

public void setValues(String prefix, String localpart, String rawname, String uri)
Convenience method to set the values of the qname components.

Parameters: prefix The qname prefix. (e.g. "a") localpart The qname localpart. (e.g. "foo") rawname The qname rawname. (e.g. "a:foo") uri The URI binding. (e.g. "http://foo.com/mybinding")

toString

public String toString()
Returns a string representation of this object.
Copyright B) 1999-2005 Apache XML Project. All Rights Reserved.