/** * Returns the first implementation of {@link PrecisionModel} matching the specified hints. * If no implementation matches, a new one is created if possible or an exception is thrown * otherwise. * * @param hints An optional map of hints, or {@code null} if none. * @return The first precision model that matches the supplied hints. * @throws FactoryRegistryException if no implementation was found or can be created for the * {@link PrecisionModel} category and the given hints. */ public static synchronized PrecisionModel getPrecisionModel(final Hints hints) throws FactoryRegistryException { return (PrecisionModel) getServiceRegistry().getServiceProvider( PrecisionModel.class, null, hints, Hints.JTS_PRECISION_MODEL); }
/** * Returns the first implementation of {@link CoordinateSequenceFactory} matching the specified * hints. If no implementation matches, a new one is created if possible or an exception is * thrown otherwise. * * @param hints An optional map of hints, or {@code null} if none. * @return The first coordinate sequence factory that matches the supplied hints. * @throws FactoryRegistryException if no implementation was found or can be created for the * {@link CoordinateSequenceFactory} interface and the given hints. */ public static synchronized CoordinateSequenceFactory getCoordinateSequenceFactory(final Hints hints) throws FactoryRegistryException { return (CoordinateSequenceFactory) getServiceRegistry().getServiceProvider( CoordinateSequenceFactory.class, null, hints, Hints.JTS_COORDINATE_SEQUENCE_FACTORY); }
/** * Returns the first implementation of {@link GridCoverageFactory} matching the specified hints. * If no implementation matches, a new one is created if possible or an exception is thrown * otherwise. * * @param hints An optional map of hints, or {@code null} if none. * @return The first grid coverage factory that matches the supplied hints. * @throws FactoryRegistryException if no implementation was found or can be created for the * {@link GridCoverageFactory} interface. * * @see Hints#DEFAULT_COORDINATE_REFERENCE_SYSTEM * @see Hints#TILE_ENCODING */ public static synchronized GridCoverageFactory getGridCoverageFactory(final Hints hints) throws FactoryRegistryException { return (GridCoverageFactory) getServiceRegistry().getServiceProvider( GridCoverageFactory.class, null, hints, null); }
/** * Returns the first implementation of {@link GeometryFactory} matching the specified hints. * If no implementation matches, a new one is created if possible or an exception is thrown * otherwise. * <p> * Hints that may be understood includes * {@link Hints#JTS_COORDINATE_SEQUENCE_FACTORY JTS_COORDINATE_SEQUENCE_FACTORY}, * {@link Hints#JTS_PRECISION_MODEL JTS_PRECISION_MODEL} and * {@link Hints#JTS_SRID JTS_SRID}. * * @param hints An optional map of hints, or {@code null} if none. * @return The first geometry factory that matches the supplied hints. * @throws FactoryRegistryException if no implementation was found or can be created for the * {@link GeometryFactory} category and the given hints. */ public static synchronized GeometryFactory getGeometryFactory(final Hints hints) throws FactoryRegistryException { return (GeometryFactory) getServiceRegistry().getServiceProvider( GeometryFactory.class, null, hints, Hints.JTS_GEOMETRY_FACTORY); }
/** * Returns the first implementation of {@link PrecisionModel} matching the specified hints. * If no implementation matches, a new one is created if possible or an exception is thrown * otherwise. * * @param hints An optional map of hints, or {@code null} if none. * @return The first precision model that matches the supplied hints. * @throws FactoryRegistryException if no implementation was found or can be created for the * {@link PrecisionModel} category and the given hints. */ public static synchronized PrecisionModel getPrecisionModel(Hints hints) throws FactoryRegistryException { hints = mergeSystemHints(hints); return (PrecisionModel) getServiceRegistry().getServiceProvider( PrecisionModel.class, null, hints, Hints.JTS_PRECISION_MODEL); }
/** * Returns the first implementation of {@link CoordinateSequenceFactory} matching the specified * hints. If no implementation matches, a new one is created if possible or an exception is * thrown otherwise. * * @param hints An optional map of hints, or {@code null} if none. * @return The first coordinate sequence factory that matches the supplied hints. * @throws FactoryRegistryException if no implementation was found or can be created for the * {@link CoordinateSequenceFactory} interface and the given hints. */ public static synchronized CoordinateSequenceFactory getCoordinateSequenceFactory(Hints hints) throws FactoryRegistryException { hints = mergeSystemHints(hints); return (CoordinateSequenceFactory) getServiceRegistry().getServiceProvider( CoordinateSequenceFactory.class, null, hints, Hints.JTS_COORDINATE_SEQUENCE_FACTORY); }
/** * Returns the first implementation of {@link GeometryFactory} matching the specified hints. * If no implementation matches, a new one is created if possible or an exception is thrown * otherwise. * <p> * Hints that may be understood includes * {@link Hints#JTS_COORDINATE_SEQUENCE_FACTORY JTS_COORDINATE_SEQUENCE_FACTORY}, * {@link Hints#JTS_PRECISION_MODEL JTS_PRECISION_MODEL} and * {@link Hints#JTS_SRID JTS_SRID}. * * @param hints An optional map of hints, or {@code null} if none. * @return The first geometry factory that matches the supplied hints. * @throws FactoryRegistryException if no implementation was found or can be created for the * {@link GeometryFactory} category and the given hints. */ public static synchronized GeometryFactory getGeometryFactory(Hints hints) throws FactoryRegistryException { hints = mergeSystemHints(hints); return (GeometryFactory) getServiceRegistry().getServiceProvider( GeometryFactory.class, null, hints, Hints.JTS_GEOMETRY_FACTORY); } /**
/** * Returns the first implementation of {@link FeatureCollections} matching the specified hints. * If no implementation matches, a new one is created if possible or an exception is thrown * otherwise. * * @param hints An optional map of hints, or {@code null} if none. * @return The first feature collections that matches the supplied hints. * @throws FactoryRegistryException if no implementation was found or can be created for the * {@link FeatureCollections} interface. * * @see Hints#FEATURE_COLLECTIONS */ public static synchronized FeatureCollections getFeatureCollections(Hints hints) { hints = mergeSystemHints(hints); return (FeatureCollections) getServiceRegistry().getServiceProvider( FeatureCollections.class, null, hints, Hints.FEATURE_COLLECTIONS); }
/** * Returns the first implementation of {@link FeatureLockFactory} matching the specified hints. * If no implementation matches, a new one is created if possible or an exception is thrown * otherwise. * * @param hints An optional map of hints, or {@code null} if none. * @return The first feature lock factory that matches the supplied hints. * @throws FactoryRegistryException if no implementation was found or can be created for the * {@link FeatureLockFactory} interface. * * @see Hints#FEATURE_LOCK_FACTORY */ public static synchronized FeatureLockFactory getFeatureLockFactory(Hints hints) { hints = mergeSystemHints(hints); return (FeatureLockFactory) getServiceRegistry().getServiceProvider( FeatureLockFactory.class, null, hints, Hints.FEATURE_LOCK_FACTORY); }
/** * Returns the first implementation of {@link StyleFactory} matching the specified hints. * If no implementation matches, a new one is created if possible or an exception is thrown * otherwise. * * @param hints An optional map of hints, or {@code null} if none. * @return The first style factory that matches the supplied hints. * @throws FactoryRegistryException if no implementation was found or can be created for the * {@link StyleFactory} interface. * * @see Hints#STYLE_FACTORY */ public static synchronized StyleFactory getStyleFactory(Hints hints) throws FactoryRegistryException { hints = mergeSystemHints(hints); return (StyleFactory) getServiceRegistry().getServiceProvider( StyleFactory.class, null, hints, Hints.STYLE_FACTORY); }
/** * Returns the first implementation of {@link AttributeTypeFactory} matching the specified hints. * If no implementation matches, a new one is created if possible or an exception is thrown * otherwise. * <p> * If no hints are provided, this method typically returns an instance of * {@link org.geotools.feature.DefaultAttributeTypeFactory}. * * @param hints An optional map of hints, or {@code null} if none. * @return The first attribute type factory that matches the supplied hints. * @throws FactoryRegistryException if no implementation was found or can be created for the * {@link AttributeTypeFactory} interface. * * @see Hints#ATTRIBUTE_TYPE_FACTORY * @see org.geotools.feature.DefaultAttributeTypeFactory */ public static synchronized AttributeTypeFactory getAttributeTypeFactory(Hints hints) { hints = mergeSystemHints(hints); return (AttributeTypeFactory) getServiceRegistry().getServiceProvider( AttributeTypeFactory.class, null, hints, Hints.ATTRIBUTE_TYPE_FACTORY); }
/** * Returns the first implementation of {@link FilterFactory} matching the specified hints. * If no implementation matches, a new one is created if possible or an exception is thrown * otherwise. * * @param hints An optional map of hints, or {@code null} if none. * @return The first filter factory that matches the supplied hints. * @throws FactoryRegistryException if no implementation was found or can be created for the * {@link FilterFactory} interface. * * @see Hints#FILTER_FACTORY */ public static synchronized FilterFactory getFilterFactory(Hints hints) throws FactoryRegistryException { hints = mergeSystemHints(hints); return (FilterFactory) getServiceRegistry().getServiceProvider( FilterFactory.class, null, hints, Hints.FILTER_FACTORY); }
/** * Returns the first implementation of {@link GridCoverageFactory} matching the specified hints. * If no implementation matches, a new one is created if possible or an exception is thrown * otherwise. * * @param hints An optional map of hints, or {@code null} if none. * @return The first grid coverage factory that matches the supplied hints. * @throws FactoryRegistryException if no implementation was found or can be created for the * {@link GridCoverageFactory} interface. * * @see Hints#DEFAULT_COORDINATE_REFERENCE_SYSTEM * @see Hints#TILE_ENCODING */ public static synchronized GridCoverageFactory getGridCoverageFactory(Hints hints) throws FactoryRegistryException { hints = mergeSystemHints(hints); return getServiceRegistry().getServiceProvider(GridCoverageFactory.class, null, hints, null); }
/** * Create a new FeatureTypeFactory with the given typeName. * * @param name The typeName of the feature to create. * * @return A new FeatureTypeFactory instance. * * @throws FactoryRegistryException If there exists a configuration error. */ public static synchronized FeatureTypeFactory newInstance(String name) throws FactoryRegistryException { FeatureTypeFactory factory = (FeatureTypeFactory) getServiceRegistry() .getServiceProvider(FeatureTypeFactory.class, null, null, null); FeatureTypeFactory newFactory; try { newFactory = (FeatureTypeFactory) factory.getClass().newInstance(); } catch (InstantiationException e) { throw new FactoryRegistryException(e.getMessage(), e); } catch (IllegalAccessException e) { throw new FactoryRegistryException(e.getMessage(), e); } newFactory.setName(name); return newFactory; }
/** * Create a new FeatureTypeFactory with the given typeName. * * @param name The typeName of the feature to create. * * @return A new FeatureTypeFactory instance. * * @throws FactoryRegistryException If there exists a configuration error. */ public static synchronized FeatureTypeFactory newInstance(String name) throws FactoryRegistryException { FeatureTypeFactory factory = (FeatureTypeFactory) getServiceRegistry() .getServiceProvider(FeatureTypeFactory.class, null, null, null); FeatureTypeFactory newFactory; try { newFactory = (FeatureTypeFactory) factory.getClass().newInstance(); } catch (InstantiationException e) { throw new FactoryRegistryException(e.getMessage(), e); } catch (IllegalAccessException e) { throw new FactoryRegistryException(e.getMessage(), e); } newFactory.setName(name); return newFactory; }
return super.getServiceProvider(category, filter, hints, key); } catch (FactoryNotFoundException exception) {
return super.getServiceProvider(category, filter, hints, key); } catch (FactoryNotFoundException exception) {