public interface Name
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:
null
, we have
made a test for this case explicit with the isGlobal() method.
Modifier and Type | Method and Description |
---|---|
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().
|
boolean isGlobal()
true
if getNamespaceURI is null
true
if getNamespaceURI is null
@UML(identifier="scope", obligation=MANDATORY, specification=ISO_19103) String getNamespaceURI()
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.
String getSeparator()
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.
String getLocalPart()
This mechanism captures the following ISO 19103 concerns:
@UML(identifier="parsedName", obligation=MANDATORY, specification=ISO_19103) String getURI()
This URI is constructed with the getNamespaceURI(), getSeparator() and getLocalPart().
This method captures the following concerns of ISO 19103 concerns:
As an example:
int hashCode()
boolean equals(Object obj)
true
if getURI is equal.Copyright © 1996–2019 Geotools. All rights reserved.