Package org.opengis.example.util
Class SimpleNameFactory
- Object
-
- SimpleNameFactory
-
- All Implemented Interfaces:
Factory,NameFactory
public class SimpleNameFactory extends Object implements NameFactory
ANameFactoryfor creatingSimpleNameinstances.
-
-
Field Summary
Fields Modifier and Type Field Description static SimpleNameFactoryDEFAULTThe default factory instance.protected LocalelocaleThe single locale supported by our simplecreateInternationalString(Map)method.protected PropertiessyntaxThe JNDI syntax of names.
-
Constructor Summary
Constructors Modifier Constructor Description SimpleNameFactory()Creates a new factory initialized to the default syntax.protectedSimpleNameFactory(SimpleNameFactory parent)Creates a new factory which will inherit syntax and locale configuration from the given parent.
-
Method Summary
Modifier and Type Method Description GenericNamecreateGenericName(NameSpace scope, CharSequence... parsedNames)Creates a local or scoped name from an array of parsed names.InternationalStringcreateInternationalString(Map<Locale,String> strings)Creates an international string.LocalNamecreateLocalName(NameSpace scope, CharSequence name)Creates a local name from the given character sequence.MemberNamecreateMemberName(NameSpace scope, CharSequence name, TypeName attributeType)Creates a member name from the given character sequence and attribute type.NameSpacecreateNameSpace(GenericName name, Map<String,?> properties)Creates a namespace having the given name and separators.TypeNamecreateTypeName(NameSpace scope, CharSequence name)Creates a type name from the given character sequence.CitationgetVendor()Returns the implementor responsible for creating the factory implementation.GenericNameparseGenericName(NameSpace scope, CharSequence name)Constructs a generic name from a qualified name.StringtoString()Returns a string representation of this factory.
-
-
-
Field Detail
-
DEFAULT
public static final SimpleNameFactory DEFAULT
The default factory instance.
-
syntax
protected final Properties syntax
The JNDI syntax of names. By default, this map contains the following entries:
Subclasses can modify this map in their constructor. This map shall not be modified after construction, because it will be passed by direct reference (no clone) to JNDI names.JNDI properties "jndi.syntax.direction" = "left_to_right" "jndi.syntax.separator" = ":" - See Also:
CompoundName
-
locale
protected final Locale locale
The single locale supported by our simplecreateInternationalString(Map)method. The default value is the system default.
-
-
Constructor Detail
-
SimpleNameFactory
public SimpleNameFactory()
Creates a new factory initialized to the default syntax.
-
SimpleNameFactory
protected SimpleNameFactory(SimpleNameFactory parent)
Creates a new factory which will inherit syntax and locale configuration from the given parent. Subclasses can modify thesyntaxproperties in their constructor.- Parameters:
parent- The parent factory.
-
-
Method Detail
-
getVendor
public Citation getVendor()
Returns the implementor responsible for creating the factory implementation.
-
createInternationalString
public InternationalString createInternationalString(Map<Locale,String> strings)
Creates an international string. The simple implementations in theorg.opengis.examplepackages accept only one locale. Consequently this factory method will select only one string in the given map: the one which is associated to the closest match of this factory locale.- Specified by:
createInternationalStringin interfaceNameFactory
-
createNameSpace
public NameSpace createNameSpace(GenericName name, Map<String,?> properties)
Creates a namespace having the given name and separators. Thepropertiesargument is optional: if non-null, the given properties may be given to the namespace to be created. This factory recognizes the properties listed in the following table:Namespace properties Property name Purpose "separator"The separator to insert between parsed names in that namespace. For URN, this is typically ":".- Specified by:
createNameSpacein interfaceNameFactory
-
createTypeName
public TypeName createTypeName(NameSpace scope, CharSequence name)
Creates a type name from the given character sequence. The character sequence shall complies to the same restriction thancreateLocalName.- Specified by:
createTypeNamein interfaceNameFactory- Parameters:
scope- the scope of the type name to be created, ornullfor a global namespace.name- the type name as a string or an international string.- Returns:
- the type name for the given character sequence.
-
createMemberName
public MemberName createMemberName(NameSpace scope, CharSequence name, TypeName attributeType)
Creates a member name from the given character sequence and attribute type.- Specified by:
createMemberNamein interfaceNameFactory- Parameters:
scope- the scope of the member name to be created, ornullfor 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.- Returns:
- the member name for the given character sequence.
- Since:
- 3.1
-
createLocalName
public LocalName createLocalName(NameSpace scope, CharSequence name)
Creates a local name from the given character sequence.- Specified by:
createLocalNamein interfaceNameFactory- Parameters:
scope- the scope of the local name to be created, ornullfor a global namespace.name- the local name as a string or an international string.- Returns:
- the local name for the given character sequence.
-
createGenericName
public GenericName createGenericName(NameSpace scope, CharSequence... parsedNames)
Creates a local or scoped name from an array of parsed names.- Specified by:
createGenericNamein interfaceNameFactory- Parameters:
scope- the scope of the generic name to be created, ornullfor 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.
-
parseGenericName
public 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 syntax-dependent separator if the given scope is null.- Specified by:
parseGenericNamein interfaceNameFactory- Parameters:
scope- the scope of the generic name to be created, ornullfor a global namespace.name- the qualified name, as a sequence of names separated by a scope-dependent separator.- Returns:
- a name parsed from the given string.
-
-