org.opengis.util
Interface NameFactory


@Extension
public interface NameFactory

Factory for generic names and international strings.

Implementation note: despite the "create" name, implementations may return cached instances.

Since:
GeoAPI 2.0
Author:
Jesse Crossley (SYS Technologies), Martin Desruisseaux (Geomatys)

Method Summary
 GenericName createGenericName(NameSpace scope, CharSequence[] parsedNames)
          Creates a local or scoped name from an array of parsed names.
 InternationalString createInternationalString(Map<Locale,String> strings)
          Creates an international string from a set of strings in different locales.
 LocalName createLocalName(GenericName scope, String name, InternationalString localizedName)
          Deprecated. Replaced by createNameSpace for the scope argument, and createLocalName for the name and localized name arguments.
 LocalName createLocalName(NameSpace scope, CharSequence name)
          Creates a local name from the given character sequence.
 NameSpace createNameSpace(GenericName name, String headSeparator, String separator)
          Creates a namespace having the given name and separators.
 ScopedName createScopedName(GenericName scope, String name, InternationalString localizedName)
          Deprecated. Replaced by createNameSpace for the scope argument, and parseGenericName for the name and localized name arguments.
 GenericName parseGenericName(NameSpace scope, CharSequence name)
          Constructs a generic name from a qualified name.
 

Method Detail

createInternationalString

InternationalString createInternationalString(Map<Locale,String> strings)
Creates an international string from a set of strings in different locales.

Parameters:
strings - String value for each locale key.
Returns:
The international string.

createNameSpace

NameSpace createNameSpace(GenericName name,
                          String headSeparator,
                          String separator)
Creates a namespace having the given name and separators.

Implementation note: despite the "create" name, implementations may return existing instances.

Parameters:
name - The name of the namespace to be returned. This argument can be created using createGenericName(null, parsedNames).
headSeparator - The separator to insert between the namespace and the head. For HTTP namespace, it is "://". For URN namespace, it is typically ":".
separator - The separator to insert between parsed names in that namespace. For HTTP namespace, it is ".". For URN namespace, it is typically ":".
Returns:
A namespace having the given name and separators.
Since:
GeoAPI 2.2

createLocalName

LocalName createLocalName(NameSpace scope,
                          CharSequence name)
Creates a local name from the given character sequence. The character sequence can be either a String or an InternationalString instance. In the later case, implementations can use an arbitrary locale (typically ENGLISH, but not necessarly) for the unlocalized string to be returned by LocalName.toString().

Parameters:
scope - The scope of the local name to be created, or null for a global namespace.
name - The local name as a string or an international string.
Returns:
The local name for the given character sequence.
Since:
GeoAPI 2.2

createGenericName

GenericName createGenericName(NameSpace scope,
                              CharSequence[] parsedNames)
Creates a local or scoped name from an array of parsed names. The array elements can be either String or InternationalString instances. In the later case, implementations can use an arbitrary locale (typically ENGLISH, but not necessarly) for the unlocalized string to be returned by GenericName.toString().

If the length of the parsedNames array is 1, then this method returns an instance of LocalName. If the length is 2 or more, then this method returns an instance of ScopedName.

Parameters:
scope - The scope of the generic name to be created, or null for a global namespace.
parsedNames - The local names as an array of strings or international strings. This array must contains at least one element.
Returns:
The generic name for the given parsed names.
Since:
GeoAPI 2.2

parseGenericName

GenericName parseGenericName(NameSpace scope,
                             CharSequence name)
Constructs a generic name from a qualified name. This method splits the given name around a separator inferred from the given scope, or an implementation-dependant default separator if the given scope is null.

For example if the scope argument is the namespace "urn:ogc:def" with ":" as the separator, and if the name argument is the string "crs:epsg:4326", then the result is a scoped name having a depth of 3, which is the length of the list of parsed names ("crs", "epsg", "4326").

Parameters:
scope - The scope of the generic name to be created, or null for a global namespace.
name - The qualified name, as a sequence of names separated by a scope-dependant separator.
Returns:
A name parsed from the given string.
Since:
GeoAPI 2.2

createLocalName

@Deprecated
LocalName createLocalName(GenericName scope,
                                     String name,
                                     InternationalString localizedName)
Deprecated. Replaced by createNameSpace for the scope argument, and createLocalName for the name and localized name arguments.

Creates a local name from a scope and a name. The scope argument identifies the name space in which the local name will be created. The name argument is taken verbatism as the string representation of the local name.

This method

Parameters:
scope - The scope, or null for the global one.
name - The unlocalized name.
localizedName - A localized version of the name, or null if none.
Returns:
The local name.

createScopedName

@Deprecated
ScopedName createScopedName(GenericName scope,
                                       String name,
                                       InternationalString localizedName)
Deprecated. Replaced by createNameSpace for the scope argument, and parseGenericName for the name and localized name arguments.

Creates a scoped name from a scope and a name. The scope argument identifies the name space in which the scoped name will be created. The name argument will be parsed in order to construct the list of parsed names.

Parameters:
scope - The scope, or null for the global one.
name - The unlocalized name.
localizedName - A localized version of the name, or null if none.
Returns:
The scoped name.


Copyright © 1996-2014 Geotools. All Rights Reserved.