Interface Factory
-
- All Known Subinterfaces:
BufferedFactory
,DataAccessFactory
,DataSourceFactorySpi
,DataStoreFactorySpi
,Driver
,FileDataStoreFactorySpi
,FileDriver
,FunctionExpression
,GridFormatFactorySpi
,OptionalFactory
,ProcessFactory
,PropertiesCollectorSPI
,Schema
- All Known Implementing Classes:
Abstract_URI_AuthorityFactory
,AbstractAuthorityFactory
,AbstractAuthorityMediator
,AbstractCachedAuthorityFactory
,AbstractCoordinateOperationFactory
,AbstractDataSourceFactorySpi
,AbstractEpsgFactory
,AbstractEpsgMediator
,AbstractFactory
,AbstractFeatureCollectionProcessFactory
,AbstractQuantityClassificationFunction
,AccessDialectEpsgFactory
,AIGFormatFactory
,AllAuthoritiesFactory
,AndFunction
,AnnotatedBeanProcessFactory
,AnnotationDrivenProcessFactory
,AnsiDialectEpsgFactory
,AppSchemaDataAccessFactory
,ArcGridFormatFactory
,AreaFunction
,ArrayFunction
,AsMultiGeometryFunctionExpression
,AtFunction
,AttributeCountFunction
,AuthorityBackedFactory
,AuthorityFactoryAdapter
,AutoCRSFactory
,BandsFunction
,BaseGridFormatFactorySPI
,BufferedAuthorityFactory
,BufferedCoordinateOperationFactory
,ByteFileNameExtractorSPI
,CachedAuthorityDecorator
,CachedCRSAuthorityDecorator
,CartesianAuthorityFactory
,CenterLineProcess
,ClassificationFunction
,ClassifyFunction
,ClasspathGridShiftLocator
,Collection_AverageFunction
,Collection_BoundsFunction
,Collection_CountFunction
,Collection_MaxFunction
,Collection_MedianFunction
,Collection_MinFunction
,Collection_SumFunction
,Collection_UniqueFunction
,CollectionIdFunction
,CollectionLinkFunction
,CoordinateOperationFactoryUsingWKT
,CRSExtractorSPI
,CSVDataStoreFactory
,CurrentDateExtractorSPI
,DateDifferenceFunction
,DateExtractorSPI
,DatumAliases
,DB2NGDataStoreFactory
,DB2NGJNDIDataStoreFactory
,DBCPDataSourceFactory
,DefaultCoordinateOperationFactory
,DefaultDriver
,DefaultFileDriver
,DefaultMathTransformFactory
,DefaultPropertiesCollectorSPI
,DeferredAuthorityFactory
,DirectAuthorityFactory
,DirectEpsgFactory
,DoubleFileNameExtractorSPI
,DTEDFormatFactory
,ECWFormatFactory
,EnvFunction
,EnviHdrFormatFactory
,EPSGCRSAuthorityFactory
,EqualAreaFunction
,EqualIntervalFunction
,ErdasImgFormatFactory
,EsriExtension
,EsriHdrFormatFactory
,FactoryUsingAnsiSQL
,FactoryUsingSQL
,FactoryUsingWKT
,FallbackAuthorityFactory
,FallbackFunction
,FeatureToFeatureProcessFactory
,FilterFactoryImpl
,FilterFactoryImplNamespaceAware
,FilterFactoryImplReportInvalidProperty
,FilterFunction_abs
,FilterFunction_abs_2
,FilterFunction_abs_3
,FilterFunction_abs_4
,FilterFunction_acos
,FilterFunction_area
,FilterFunction_asin
,FilterFunction_atan
,FilterFunction_atan2
,FilterFunction_between
,FilterFunction_boundary
,FilterFunction_boundaryDimension
,FilterFunction_buffer
,FilterFunction_bufferWithSegments
,FilterFunction_ceil
,FilterFunction_centroid
,FilterFunction_contains
,FilterFunction_Convert
,FilterFunction_convexHull
,FilterFunction_cos
,FilterFunction_crosses
,FilterFunction_dateFormat
,FilterFunction_dateParse
,FilterFunction_difference
,FilterFunction_dimension
,FilterFunction_disjoint
,FilterFunction_disjoint3D
,FilterFunction_distance
,FilterFunction_distance3D
,FilterFunction_double2bool
,FilterFunction_endAngle
,FilterFunction_endPoint
,FilterFunction_envelope
,FilterFunction_equalsExact
,FilterFunction_equalsExactTolerance
,FilterFunction_equalTo
,FilterFunction_exp
,FilterFunction_exteriorRing
,FilterFunction_floor
,FilterFunction_geometryType
,FilterFunction_geomFromWKT
,FilterFunction_geomLength
,FilterFunction_getGeometryN
,FilterFunction_getX
,FilterFunction_getY
,FilterFunction_getZ
,FilterFunction_greaterEqualThan
,FilterFunction_greaterThan
,FilterFunction_IEEEremainder
,FilterFunction_if_then_else
,FilterFunction_in10
,FilterFunction_in2
,FilterFunction_in3
,FilterFunction_in4
,FilterFunction_in5
,FilterFunction_in6
,FilterFunction_in7
,FilterFunction_in8
,FilterFunction_in9
,FilterFunction_int2bbool
,FilterFunction_int2ddouble
,FilterFunction_interiorPoint
,FilterFunction_interiorRingN
,FilterFunction_intersection
,FilterFunction_intersects
,FilterFunction_intersects3D
,FilterFunction_isClosed
,FilterFunction_isCoverage
,FilterFunction_isEmpty
,FilterFunction_isLike
,FilterFunction_isNull
,FilterFunction_isometric
,FilterFunction_isRing
,FilterFunction_isSimple
,FilterFunction_isValid
,FilterFunction_isWithinDistance
,FilterFunction_isWithinDistance3D
,FilterFunction_lessEqualThan
,FilterFunction_lessThan
,FilterFunction_list
,FilterFunction_listMultiply
,FilterFunction_log
,FilterFunction_max
,FilterFunction_max_2
,FilterFunction_max_3
,FilterFunction_max_4
,FilterFunction_min
,FilterFunction_min_2
,FilterFunction_min_3
,FilterFunction_min_4
,FilterFunction_minimumCircle
,FilterFunction_minimumDiameter
,FilterFunction_minimumRectangle
,FilterFunction_not
,FilterFunction_notEqualTo
,FilterFunction_numberFormat
,FilterFunction_numberFormat2
,FilterFunction_numGeometries
,FilterFunction_numInteriorRing
,FilterFunction_numPoints
,FilterFunction_octagonalEnvelope
,FilterFunction_offset
,FilterFunction_overlaps
,FilterFunction_parseBoolean
,FilterFunction_parseDouble
,FilterFunction_parseInt
,FilterFunction_parseLong
,FilterFunction_pgNearest
,FilterFunction_pointN
,FilterFunction_pow
,FilterFunction_property
,FilterFunction_random
,FilterFunction_relate
,FilterFunction_relatePattern
,FilterFunction_rint
,FilterFunction_round
,FilterFunction_round_2
,FilterFunction_roundDouble
,FilterFunction_sdonn
,FilterFunction_setCRS
,FilterFunction_sin
,FilterFunction_sqrt
,FilterFunction_startAngle
,FilterFunction_startPoint
,FilterFunction_strAbbreviate
,FilterFunction_strCapitalize
,FilterFunction_strConcat
,FilterFunction_strDefaultIfBlank
,FilterFunction_strEndsWith
,FilterFunction_strEqualsIgnoreCase
,FilterFunction_strIndexOf
,FilterFunction_strLastIndexOf
,FilterFunction_strLength
,FilterFunction_strMatches
,FilterFunction_strPosition
,FilterFunction_strReplace
,FilterFunction_strStartsWith
,FilterFunction_strStripAccents
,FilterFunction_strSubstring
,FilterFunction_strSubstringStart
,FilterFunction_strToLowerCase
,FilterFunction_strToUpperCase
,FilterFunction_strTrim
,FilterFunction_strTrim2
,FilterFunction_symDifference
,FilterFunction_tan
,FilterFunction_toDegrees
,FilterFunction_toRadians
,FilterFunction_touches
,FilterFunction_toWKT
,FilterFunction_union
,FilterFunction_vertices
,FilterFunction_within
,FilterSchema
,FloatFileNameExtractorSPI
,FSDateExtractorSPI
,FunctionExpressionImpl
,GeoJSONDataStoreFactory
,GeometryFunction
,GeometryProcessFactory
,GeoPackageFormatFactorySpi
,GeoPkgDataStoreFactory
,GeoTiffFormatFactorySpi
,GetFunction
,GMLSchema
,GrassCoverageFormatFactory
,GRIBFormatFactorySPI
,GridCoverageFactory
,H2DataStoreFactory
,H2GISDataStoreFactory
,H2GISJNDIDataStoreFactory
,H2JNDIDataStoreFactory
,HanaDataStoreFactory
,HanaJNDIDataStoreFactory
,HasFunction
,HsqlDialectEpsgMediator
,HTTP_AuthorityFactory
,HTTP_URI_AuthorityFactory
,IAUAuthorityFactory
,IAULongitudeFirstFactory
,IDFunction
,IDFunctionExpression
,IDRISIFormatFactory
,ImageMosaicFormatFactory
,ImagePyramidFormatFactory
,InArrayFunction
,InformixDataStoreFactory
,InformixJNDIDataStoreFactory
,InFunction
,IntegerFileNameExtractorSPI
,JDBCDataStoreFactory
,JDBCJNDIDataStoreFactory
,JDTSSQLServerJNDIDataStoreFactory
,JenksNaturalBreaksFunction
,JNDIDataSourceFactory
,JniOGRDataStoreFactory
,JP2ECWFormatFactory
,JP2KFormatFactory
,JP2KFormatFactory
,JP2MrSIDFormatFactory
,JsonArrayContainsFunction
,JsonPointerFunction
,JsonSelectAllFunction
,JsonSelectFunction
,JTDSSqlServerDataStoreFactory
,LapplyFunction
,LengthFunction
,LinFunction
,ListSizeFunction
,LitemFunction
,LiterateFunction
,LongFileNameExtractorSPI
,LongitudeFirstEpsgDecorator
,LongitudeFirstFactory
,ManyAuthoritiesFactory
,MapBoxAnchorFunction
,MapBoxLengthFunction
,MapGetFunction
,MBTilesDataStoreFactory
,MBTilesFormatFactorySpi
,MongoDataStoreFactory
,MrSIDFormatFactory
,MySQLDataStoreFactory
,MySQLJNDIDataStoreFactory
,NADCONGridShiftFactory
,NestedCollectionLinkFunction
,NetCDFAuxiliaryStoreFactory
,NetCDFCRSAuthorityFactory
,NetCDFDriver
,NetCDFFormatFactorySPI
,NITFFormatFactory
,NorthFix
,NowFunction
,NTv2GridShiftFactory
,OGCAPICRSFactory
,OGCSchema
,OGRDataStoreFactory
,OracleNGDataStoreFactory
,OracleNGJNDIDataStoreFactory
,OracleNGOCIDataStoreFactory
,OrderedAxisAuthorityFactory
,OrderedAxisCRSAuthorityFactory
,OrFunction
,PaletteFunction
,ParameterCQLExpressionFilterFactoryImpl
,PGRasterFactory
,PiFunction
,PointOnLineFunction
,PolygonLabelProcess
,PostgisNGDataStoreFactory
,PostgisNGJNDIDataStoreFactory
,PreGeneralizedDataStoreFactory
,PropertyAuthorityFactory
,PropertyCoordinateOperationAuthorityFactory
,PropertyDataStoreFactory
,PropertyExistsFunction
,QuantileFunction
,RasterProcessFactory
,ReferencingFactory
,ReferencingFactoryContainer
,ReferencingObjectFactory
,RescaleToPixelsFunction
,ResolutionExtractorSPI
,ResolutionXExtractorSPI
,ResolutionYExtractorSPI
,RPFTOCFormatFactory
,RuntimeExtractorSPI
,SampleDataAccessFactory
,ShapefileDataStoreFactory
,ShapefileDirectoryFactory
,ShortFileNameExtractorSPI
,SingleProcessFactory
,SizeFunction
,SkeletonizeProcess
,sldSchema
,SQLServerDataStoreFactory
,SQLServerJNDIDataStoreFactory
,SRPFormatFactory
,STACDataStoreFactory
,StandardDeviationFunction
,StaticMethodsProcessFactory
,StringFileNameExtractorSPI
,SVGGraphicFactory
,TeradataDataStoreFactory
,TeradataJNDIDataStoreFactory
,ThreadedAuthorityFactory
,ThreadedEpsgFactory
,ThreadedHsqlEpsgFactory
,ThreadedPostgreSQLEpsgFactory
,TimestampFileNameExtractorSPI
,ToRgb
,TPKFormatFactorySpi
,TransformedAuthorityFactory
,UniqueIntervalFunction
,UnnamedExtension
,URLEncodeFunction
,URN_AuthorityFactory
,VectorMosaicStoreFactory
,VectorProcessFactory
,VPFDataStoreFactory
,VPFFileFactory
,VRTFormatFactory
,VSIFormatFactory
,WebCRSFactory
,WFSDataAccessFactory
,WFSDataStoreFactory
,WMSSchema
,WorldImageFormatFactory
,XLinkSchema
,ZoomLevelFunction
public interface Factory
Base interface for Geotools factories (i.e. service discovery).This interfaces forms the core of the Geotools plug-in system, by which capabilities can be added to the library at runtime. Each sub-interface defines a service. Most services are set up with concrete implementation being registered for use in a service registry, which acts as a container for service implementations.
Service registries don't need to be a Geotools implementation. They can be (but are not limited to) any
ServiceRegistry
subclass. If the standardServiceRegistry
(or its Geotools extensionFactoryRegistry
) is selected as a container for services, then factory implementations should be declared as below (select only one way):- Register for automatic discovery
- Provide a public no-arguments constructor.
- Add the fully qualified name of the implementation class in the
META-INF/services/
classname file where classname is the fully qualified name of the service interface. - The factory implementations will be discovered when
FactoryRegistry.scanForPlugins()
will be invoked.
- Or register explicitly by application code
- Invoke
ServiceRegistry#registerServiceProvider
in application code.
- Invoke
In addition, it is recommended that implementations provide a constructor expecting a single
Hints
argument. This optional argument gives to the user some control of the factory's low-level details. The amount of control is factory specific. The geotools library defines a global class calledHints
that is ment as API (i.e. you can assume these hints are supported). Factories may also provide information on their own custom hints as part of their javadoc class description. Examples:-
An application supplied a datum factory hint, being passed to a datum authority factory so that all datum created from an authority code will come from the supplied datum factory.
-
An application supplied a
org.geotools.feature.FeatureFactory
(ensuring all constructed features support the Eclipse'sIAdaptable
interface), being passed to aorg.geotools.feature.FeatureTypeFactory
so that allFeatureTypes
constructed will produce features supporting the indicated interface.
As seen in those examples this concept of a hint becomes more interesting when the operation being controlled is discovery of other services used by the Factory. By supplying appropriate hints one can chain together several factories and retarget them to an application specific task.
- Author:
- Ian Schneider, Martin Desruisseaux, Jody Garnett
- See Also:
Hints
,FactoryRegistry
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default Map<RenderingHints.Key,?>
getImplementationHints()
Map of hints (maybe unmodifiable) used by this factory to customize its use.
-
-
-
Method Detail
-
getImplementationHints
default Map<RenderingHints.Key,?> getImplementationHints()
Map of hints (maybe unmodifiable) used by this factory to customize its use. This map is not guaranteed to contains all the hints supplied by the user; it may be only a subset. Consequently, hints provided here are usually not suitable for creating new factories, unless the implementation make some additional garantees.The primary purpose of this method is to determine if an existing factory instance can be reused for a set of user-supplied hints. This method is invoked by
FactoryRegistry
in order to compare this factory's hints against user's hints. This is dependency introspection only;FactoryRegistry
never invokes this method for creating new factories.Keys are usually static constants from the
Hints
class, while values are instances of some key-dependent class. The key set must contains at least all hints impacting functionality. While the key set may contains all hints supplied by the user, it is recommended to limit the set to only the hints used by this particular factory instance. A minimal set will helpsFactoryRegistry
to compare only hints that matter and avoid the creation of unnecessary instances of this factory.The hint values may be different than the one supplied by the user. If a user supplied a hint as a
Class
object, this method shall replace it by the actual instance used, if possible.Implementations of this method are usually quite simple. For example if a datum authority factory uses an ordinary datum factory, its method could be implemented as below (note that we should not check if the datum factory is null, since key with null value is the expected behaviour in this case). Example:
Map hints = new HashMap(); hints.put(Hints.DATUM_FACTORY, datumFactory); return hints;
- Returns:
- The map of hints, or an {@linkplain java.util.Collections.emptyMap() empty map} if none.
-
-