public interface NameFactory
Note:
Despite the "create
" name, implementations may return cached instances.
Departure from OGC/ISO specification:
Added in order to provide constructors forGenericName
and related interfaces.
Modifier and Type | Method and Description |
---|---|
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(NameSpace scope,
CharSequence name)
Creates a local name from the given character sequence.
|
NameSpace |
createNameSpace(GenericName name,
Map<String,?> properties)
Creates a namespace having the given name and separators.
|
TypeName |
createTypeName(NameSpace scope,
CharSequence name)
Creates a type name from the given character sequence.
|
GenericName |
parseGenericName(NameSpace scope,
CharSequence name)
Constructs a generic name from a qualified name.
|
InternationalString createInternationalString(Map<Locale,String> strings)
strings
- String value for each locale key.NameSpace createNameSpace(GenericName name, Map<String,?> properties)
properties
argument
is optional: if non-null, the given properties may be given to the namespace to be created.
The properties can include for example the separator character to be used between the
parsed names.
Implementations are encouraged to recognize at least the properties listed in the following table. Additional implementation-specific properties can be added. Unknown properties shall be ignored.
Property name | Purpose |
---|---|
"separator" |
The separator to insert between parsed names in that namespace. For HTTP namespace, it is "." . For URN namespace,
it is typically ":" . |
"separator.head" |
The separator to insert between the namespace and the
head. For HTTP namespace, it is "://" .
For URN namespace, it is typically ":" . If this entry is omitted, then
the default shall be the same value than the "separator" entry. |
name
- The name of the namespace to be returned. This argument can be created using
createGenericName(null, parsedNames)
.properties
- An optional map of properties to be assigned to the namespace.TypeName createTypeName(NameSpace scope, CharSequence name)
createLocalName
.scope
- The scope of the type name to be created,
or null
for a global namespace.name
- The type name as a string or an international string.LocalName createLocalName(NameSpace scope, CharSequence name)
String
or an InternationalString
instance. In the later case, implementations
can use an arbitrary locale (typically ENGLISH
,
but not necessarily) for the unlocalized string to be returned by LocalName.toString()
.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.GenericName createGenericName(NameSpace scope, CharSequence... parsedNames)
String
or InternationalString
instances. In the later case, implementations
can use an arbitrary locale (typically ENGLISH
,
but not necessarily) 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
.
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.GenericName parseGenericName(NameSpace scope, CharSequence name)
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"
).
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-dependent separator.Copyright © 1994–2019 Open Geospatial Consortium. All rights reserved.