fedora.common.xml.namespace
Class QName

java.lang.Object
  extended by fedora.common.xml.namespace.QName

public class QName
extends java.lang.Object

A namespace-qualified name in XML.

Author:
cwilper@cs.cornell.edu

Field Summary
 java.lang.String localName
          The local part of the qualified name.
 XMLNamespace namespace
          The namespace to which this name belongs.
 java.lang.String qName
          A string of the form: prefix:localName, acceptable for use in an instance document.
 
Constructor Summary
QName(XMLNamespace namespace, java.lang.String localName)
          Constructs an instance.
 
Method Summary
 boolean equals(java.lang.Object o)
          Returns true iff the given object is an instance of this class and has the same namespace and localName values.
 int hashCode()
          
 java.lang.String toString()
          Returns a string of the form: {namespace-uri}localName.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

namespace

public final XMLNamespace namespace
The namespace to which this name belongs.


localName

public final java.lang.String localName
The local part of the qualified name.


qName

public final java.lang.String qName
A string of the form: prefix:localName, acceptable for use in an instance document. The prefix used will be the preferred prefix of the namespace.

Constructor Detail

QName

public QName(XMLNamespace namespace,
             java.lang.String localName)
Constructs an instance.

Parameters:
namespace - the namespace to which this name belongs.
localName - the local part of the qualified name.
Throws:
java.lang.IllegalArgumentException - if either parameter is null.
Method Detail

toString

public java.lang.String toString()
Returns a string of the form: {namespace-uri}localName.

Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Returns true iff the given object is an instance of this class and has the same namespace and localName values.

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()

Overrides:
hashCode in class java.lang.Object