net.sf.jsefa.xml.namespace
Class QName

java.lang.Object
  extended by net.sf.jsefa.xml.namespace.QName

public final class QName
extends Object

A qualified name consisting of a namespace uri and a local name.

Both must not be null. Use NamespaceConstants.NO_NAMESPACE_URI to describe that no namespace is given.

Instances of this class are immutable and thread safe.

Author:
Norman Lahme-Huetig

Method Summary
static QName create(String localName)
          Creates a new QName with no namespace URI.
static QName create(String uri, String localName)
          Creates a new QName.
 boolean equals(Object obj)
          
 String getLocalName()
          Returns the local name.
 String getUri()
          Returns the namespace uri.
 int hashCode()
          
 String toString()
          Returns a String representation of this qualified name with the following format: [uri#]localName.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

create

public static QName create(String localName)
Creates a new QName with no namespace URI.

Parameters:
localName - the local name
Returns:
the name

create

public static QName create(String uri,
                           String localName)
Creates a new QName.

Use NamespaceConstants.NO_NAMESPACE_URI for the argument uri if no namespace is given.

Parameters:
uri - the namespace uri (not null)
localName - the local name
Returns:
the name

getLocalName

public String getLocalName()
Returns the local name.

Returns:
the local name

getUri

public String getUri()
Returns the namespace uri.

Returns:
the namespace uri

equals

public boolean equals(Object obj)

Overrides:
equals in class Object

hashCode

public int hashCode()

Overrides:
hashCode in class Object

toString

public String toString()
Returns a String representation of this qualified name with the following format:

[uri#]localName.

Overrides:
toString in class Object
Returns:
the String representation of this qualified name


Copyright © 2014. All rights reserved.