|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectFactory
DefaultNameFactory
@ThreadSafe public class DefaultNameFactory
A factory for AbstractName objects.
FactoryFinder.getNameFactory(Hints)
| metadata/geotk-metadata (download) | View source code for this class |
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class Factory |
|---|
Factory.Availability, Factory.Organizer |
| Field Summary |
|---|
| Fields inherited from class Factory |
|---|
EMPTY_HINTS, hints |
| Constructor Summary | |
|---|---|
DefaultNameFactory()
Creates a new factory. |
|
| 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(NameSpace scope,
CharSequence name)
Creates a local name from the given character sequence. |
MemberName |
createMemberName(NameSpace scope,
CharSequence name,
TypeName attributeType)
Creates a member name from the given character sequence and attribute type. |
NameSpace |
createNameSpace(GenericName name)
Deprecated. Replaced by createNameSpace(GenericName, Map). |
NameSpace |
createNameSpace(GenericName name,
Map<String,?> properties)
Creates a namespace having the given name. |
TypeName |
createTypeName(NameSpace scope,
CharSequence name)
Creates a type name from the given character sequence. |
Citation |
getVendor()
Returns the implementor of this factory, which is GEOTOOLKIT. |
GenericName |
parseGenericName(NameSpace scope,
CharSequence name)
Constructs a generic name from a qualified name. |
GenericName[] |
toArray(Object value)
Converts the given value to an array of generic names. |
| Methods inherited from class Factory |
|---|
availability, dispose, equals, getImplementationHints, hasCompatibleHints, hashCode, setOrdering, toString |
| Methods inherited from class Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultNameFactory()
FactoryFinder.getNameFactory(Hints) instead.
| Method Detail |
|---|
public Citation getVendor()
GEOTOOLKIT.
getVendor in interface Factorypublic InternationalString createInternationalString(Map<Locale,String> strings)
createInternationalString in interface NameFactory
public NameSpace createNameSpace(GenericName name,
Map<String,?> properties)
This method can receive an optional map of properties. Recognized entries are:
| 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 is the same value than the "separator" entry. |
createNameSpace in interface NameFactoryname - 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, or null if none.
@Deprecated public NameSpace createNameSpace(GenericName name)
createNameSpace(GenericName, Map).
name - The name of the namespace to be returned. This argument can be created using
createGenericName(null, parsedNames).
public TypeName createTypeName(NameSpace scope,
CharSequence name)
DefaultTypeName instance.
createTypeName in interface NameFactoryscope - 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.
NullArgumentException - If the name argument is null.
public MemberName createMemberName(NameSpace scope,
CharSequence name,
TypeName attributeType)
DefaultMemberName
instance.
createMemberName in interface NameFactoryscope - The scope of the member
name to be created, or null for a global namespace.name - The member name as a string or an international string.attributeType - The type of the data associated with the record member.
NullArgumentException - If the name or attributeType argument is null.
public LocalName createLocalName(NameSpace scope,
CharSequence name)
DefaultLocalName instance.
createLocalName in interface NameFactoryscope - 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.
NullArgumentException - If the name argument is null.
public GenericName createGenericName(NameSpace scope,
CharSequence... parsedNames)
DefaultLocalName if the length of the parsedNames
array is 1, or an instance of DefaultScopedName if the length of the array is 2
or more.
createGenericName in interface NameFactoryscope - 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.
NullArgumentException - If the given array is empty.
public GenericName parseGenericName(NameSpace scope,
CharSequence name)
parseGenericName in interface NameFactoryscope - 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.
public GenericName[] toArray(Object value)
throws ClassCastException
GenericName, String or any other type enumerated below, then it is converted
and returned in an array of length 1. If the given value is an array or a collection, then an
array of same length is returned where each element has been converted. Allowed types or
element types are:
GenericName, to be casted and returned as-is.CharSequence (usually a String or an InternationalString), to
be parsed as a generic name using the default separator.Identifier, its code to be parsed as a generic
name using the default separator.
value - The object to cast into an array of generic names.
value.
NullArgumentException - if value is null.
ClassCastException - if value can't be casted.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||