deegree 2.5 (2011/06/29 09:44 build-8-official)

org.deegree.datatypes
Class QualifiedName

java.lang.Object
  extended by org.deegree.datatypes.QualifiedName
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
CoordinateSystem

public class QualifiedName
extends java.lang.Object
implements java.io.Serializable

This class represent a qualified name for something. A name is thought to be built from an optional prefix and/or a local name E.g.:
- deegree - pre:deegree
a name may be located within a namespace assigned to the names prefix (or as default namespace if the name has not prefix).

Version:
$Revision: 21574 $, $Date: 2009-12-21 16:37:50 +0100 (Mo, 21 Dez 2009) $
Author:
Andreas Poth , last edited by: $Author: apoth $
See Also:
Serialized Form

Constructor Summary
QualifiedName(javax.xml.namespace.QName name)
          Creates a new QualifiedName instance from a QName
QualifiedName(java.lang.String name)
           
QualifiedName(java.lang.String prefix, java.lang.String localName, java.net.URI namespace)
           
QualifiedName(java.lang.String name, java.net.URI namespace)
           
 
Method Summary
 boolean equals(java.lang.Object o)
           
 java.lang.String getAsString()
          Deprecated. use
 java.lang.String getFormattedString()
           
 java.lang.String getLocalName()
          returns the local part of the name
 java.net.URI getNamespace()
          returns the namespace the name is located within (may be null)
 java.lang.String getPrefix()
          returns the names prefix
 java.lang.String getPrefixedName()
          returns a string representation of a QualifiedName. prefix and local name are separated by ':'.
 int hashCode()
           
 boolean isInNamespace(java.net.URI ns)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

QualifiedName

public QualifiedName(javax.xml.namespace.QName name)
Creates a new QualifiedName instance from a QName

Parameters:
name -

QualifiedName

public QualifiedName(java.lang.String name)
Parameters:
name - local name/simple (without prefix)

QualifiedName

public QualifiedName(java.lang.String name,
                     java.net.URI namespace)
Parameters:
name - complete name including a prefix
namespace - namespace the name is located within

QualifiedName

public QualifiedName(java.lang.String prefix,
                     java.lang.String localName,
                     java.net.URI namespace)
Parameters:
prefix -
localName - local/simple name (e.g. deegree)
namespace - namespace the name is located within
Method Detail

getAsString

@Deprecated
public java.lang.String getAsString()
Deprecated. use

returns a string representation of a QualifiedName. prefix and local name are separated by ':'

Returns:
string representation of a QualifiedName
See Also:
or, instead

getPrefixedName

public java.lang.String getPrefixedName()
returns a string representation of a QualifiedName. prefix and local name are separated by ':'. If the Prefix is null, the sole localname will be returned.

Returns:
string representation of a QualifiedName

getFormattedString

public java.lang.String getFormattedString()
Returns:
a QualifiedName as a formatted string. If a QualifiedName has a namespace the returned format is:
{namespace}:localName.
Otherwise just a String representation of this qualified name will be returned. Which means, that if the prefix is not null (allthough not bound to namespace) the result String will be:
PRE_FIX:localName.
If the Prefix is null, the sole localname will be returned.

getPrefix

public java.lang.String getPrefix()
returns the names prefix

Returns:
the names prefix

getLocalName

public java.lang.String getLocalName()
returns the local part of the name

Returns:
the local part of the name

getNamespace

public java.net.URI getNamespace()
returns the namespace the name is located within (may be null)

Returns:
the namespace the name is located within (may be null)

isInNamespace

public boolean isInNamespace(java.net.URI ns)
Parameters:
ns - the namespace to checkfor
Returns:
true if the given namespace equals this qualified name's namespace. If the given ns is null and the namespace is null, this method will also return true.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

deegree 2.5 (2011/06/29 09:44 build-8-official)

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org