Class SimpleNameFactory

    • 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:
        JNDI properties
        "jndi.syntax.direction" = "left_to_right"
        "jndi.syntax.separator" = ":"
        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.
        See Also:
        CompoundName
    • 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 the syntax properties in their constructor.
        Parameters:
        parent - The parent factory.
    • Method Detail

      • getVendor

        public Citation getVendor()
        Returns the implementor responsible for creating the factory implementation.
        Specified by:
        getVendor in interface Factory
      • createInternationalString

        public InternationalString createInternationalString​(Map<Locale,​String> strings)
        Creates an international string. The simple implementations in the org.opengis.example packages 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:
        createInternationalString in interface NameFactory
      • createNameSpace

        public NameSpace createNameSpace​(GenericName name,
                                         Map<String,​?> properties)
        Creates a namespace having the given name and separators. The properties argument 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:
        createNameSpace in interface NameFactory
      • 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 than createLocalName.
        Specified by:
        createTypeName in interface NameFactory
        Parameters:
        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.
        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:
        createMemberName in interface NameFactory
        Parameters:
        scope - 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.
        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:
        createLocalName in interface NameFactory
        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.
      • createGenericName

        public GenericName createGenericName​(NameSpace scope,
                                             CharSequence... parsedNames)
        Creates a local or scoped name from an array of parsed names.
        Specified by:
        createGenericName in interface NameFactory
        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.
      • 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:
        parseGenericName in interface NameFactory
        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-dependent separator.
        Returns:
        a name parsed from the given string.
      • toString

        public String toString()
        Returns a string representation of this factory.
        Overrides:
        toString in class Object