org.opengis.feature.type
Interface Name

All Known Implementing Classes:
GeometryOperand, NameImpl

public interface Name

A qualified Name (with respect to a namespace rather than just a simple prefix).

This interface provides method names similar to the Java QName interface in order to facilitate those transition from an XML models. We are recording the a full namespace (rather than just a prefix) in order to sensibly compare Names produced from different contexts. Since the idea of a "prefix" in a QName is only used to refer to a namespace defined earlier in the document it is sensible for us to ask this prefix be resolved (allowing us to reliability compare names produced from different documents; or defined by different repositories).

Notes: Name is a lightweight data object with identity (equals method) based on getNameSpaceURI() and getLocalPart() information. This interface is strictly used for identification and should not be extended to express additional functionality.

Author:
Jody Garnett (Refractions Research, Inc.)

Method Summary
 boolean equals(Object obj)
          true if getURI is equal.
 String getLocalPart()
          Retrieve the "local" name.
 String getNamespaceURI()
          Returns the URI of the namespace for this name.
 String getSeparator()
          Separator to use between getNamespaceURI() and getLocalPart() when constructing getURI().
 String getURI()
          Convert this name to a complete URI.
 int hashCode()
          Must be based on getURI().
 boolean isGlobal()
          Returns true if getNamespaceURI is null
 String toString()
          A local-independent representation of this name, see getURI().
 

Method Detail

isGlobal

boolean isGlobal()
Returns true if getNamespaceURI is null

Returns:
Returns true if getNamespaceURI is null

getNamespaceURI

@UML(identifier="scope",
     obligation=MANDATORY,
     specification=ISO_19103)
String getNamespaceURI()
Returns the URI of the namespace for this name.

In ISO 19103 this is known as scope and containes a backpointer to the containing namespace. This solution is too heavy for our purposes, and we expect applications to provide their own lookup mechanism through which they can use this URI.

The namespace URI does serve to make this name unique and is checked as part of the equals operation.

Since:
GeoAPI 2.1

getSeparator

String getSeparator()
Separator to use between getNamespaceURI() and getLocalPart() when constructing getURI().

This separator is only used to construct a visually pleasing getURI() result. The value to use as a separator depends on the registry or namespace you are working with. JNDI naming services have been known to use "/" and ":". Referring to an element in an XMLSchema document has been represented with a "#" symbol.

Returns:
A separator (such as "/" or ":").

getLocalPart

String getLocalPart()
Retrieve the "local" name.

This mechanism captures the following ISO 19103 concerns:

Returns:
local name (can be used in namespace lookup)

getURI

@UML(identifier="parsedName",
     obligation=MANDATORY,
     specification=ISO_19103)
String getURI()
Convert this name to a complete URI.

This URI is constructed with the getNamespaceURI(), getSeparator() and getLocalPart().

This method captures the following concerns of ISO 19103 concerns:

As an example:

Both return: "gopher://localhost/example/name" as they indicate the same entry in the namespace system (such as a Registry or JNDI naming service).

Returns:
a complete URI constructed of namespace URI and the local part.

hashCode

int hashCode()
Must be based on getURI().

Overrides:
hashCode in class Object
Returns:
a hascode based on getURI()

equals

boolean equals(Object obj)
true if getURI is equal.

Overrides:
equals in class Object
Parameters:
other -
Returns:
true if getURI is equal.

toString

String toString()
A local-independent representation of this name, see getURI().

Overrides:
toString in class Object


Copyright © 1996-2014 Geotools. All Rights Reserved.