Package org.geotools.util
Class NameFactory
- Object
-
- NameFactory
-
public final class NameFactory extends Object
A factory forGenericName
objects.- Since:
- 2.1
- Author:
- Martin Desruisseaux
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static GenericName
create(CharSequence... names)
Constructs a generic name from an array of local names and the default separator character.static GenericName
create(CharSequence[] names, char separator)
Constructs a generic name from an array of local names and the specified separator character.static GenericName
create(String name)
Constructs a generic name from a fully qualified name and the default separator character.static GenericName
create(String name, char separator)
Constructs a generic name from a fully qualified name and the specified separator character.static GenericName[]
toArray(Object value)
Returns the specified name in an array.
-
-
-
Method Detail
-
create
public static GenericName create(String name)
Constructs a generic name from a fully qualified name and the default separator character.- Parameters:
name
- The fully qualified name.
-
create
public static GenericName create(String name, char separator)
Constructs a generic name from a fully qualified name and the specified separator character.- Parameters:
name
- The fully qualified name.separator
- The separator character.
-
create
public static GenericName create(CharSequence... names)
Constructs a generic name from an array of local names and the default separator character. If any of the specified names is anInternationalString
, then thetoString(null)
method will be used in order to fetch an unlocalized name. Otherwise, thetoString()
method will be used.- Parameters:
names
- The local names as an array of strings or international strings. This array must contains at least one element.
-
create
public static GenericName create(CharSequence[] names, char separator)
Constructs a generic name from an array of local names and the specified separator character. If any of the specified names is anInternationalString
, then thetoString(null)
method will be used in order to fetch an unlocalized name. Otherwise, thetoString()
method will be used.- Parameters:
names
- The local names as an array of strings. This array must contains at least one element.separator
- The separator character to use.
-
toArray
public static GenericName[] toArray(Object value) throws ClassCastException
Returns the specified name in an array. Thevalue
may be either aString
,String[]
,GenericName
orGenericName[]
. This method is used inAbstractIdentifiedObject
constructors.- Parameters:
value
- The object to cast into an array of generic names.- Returns:
- The generic names.
- Throws:
ClassCastException
- ifvalue
can't be cast.
-
-