Interface ObjectFactory

All Superinterfaces:
All Known Subinterfaces:
CoordinateOperationFactory, CRSFactory, CSFactory, DatumFactory

public interface ObjectFactory extends Factory
Base interface for all factories of identified objects. Factories build up complex objects from simpler objects or values. This factory allows applications to make coordinate systems, datum or coordinate reference systems that cannot be created by an authority factory. This factory is very flexible, whereas the authority factory is easier to use.

Object properties

Most factory methods expect a Map<String,?> argument. The table below lists the keys that ObjectFactory implementations shall accept, together with the type of values associated to those keys (the alternative types column gives examples of types that factory implementations may accept as well for convenience). A value for the "name" key is mandatory, while all other properties are optional. Factory methods shall ignore unknown properties.
Keys for standard properties
Key Value type Alternative types Value returned by
"name" Identifier String (see alternative below) IdentifiedObject.getName()
"alias" GenericName[] GenericName, String or String[] IdentifiedObject.getAlias()
"identifiers" Identifier[] Identifier IdentifiedObject.getIdentifiers()
"remarks" InternationalString String (see localization below) IdentifiedObject.getRemarks()
Note: multi-values are arrays instead of collections in order to allow implementations to check the element type by Java reflection. Such reflection cannot be performed on collections because of type erasure.

Implementations may allow an alternative way to define the "name" property for user convenience:

Convenience keys (non-standard)
Key Value type Alternative types Value returned by
"name" String Identifier.getCode()
"authority" Citation String Identifier.getAuthority()
"codespace" String Identifier.getCodeSpace()
"version" String Identifier.getVersion()


Localizable attributes like "remarks" can be specified either as a single InternationalString, or as one or many Strings associated to keys suffixed by a language and country code. For example, the "remarks_fr" key stands for remarks in French and the "remarks_fr_CA" key stands for remarks in French Canadian.
Departure from OGC/ISO abstract specification:
Departure for harmonization between different specifications This interface is not part of any OGC specification. It is added for uniformity, in order to provide a common base class for all referencing factories producing IdentifiedObject instances.