/** * 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 FilterFactory getFilterFactory(Hints hints) throws FactoryRegistryException { hints = mergeSystemHints(hints); return (FilterFactory) lookup(FilterFactory.class, hints, Hints.FILTER_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 StyleFactory getStyleFactory(Hints hints) throws FactoryRegistryException { hints = mergeSystemHints(hints); return (StyleFactory) lookup(StyleFactory.class, hints, Hints.STYLE_FACTORY); } /**
/** * Return the first implementation of {@link FeatureTypeFactory} matching the specified hints. * * <p>If no implementation matches, a new one is created if possible or an exception is thrown. * * @param hints An optional map of hints; or {@code null} if none * @return Instance of FeatureTypeFactory matching the supplied hints * @throws FactoryRegistryException if no implementation could be provided * @see Hints#FEATURE_TYPE_FACTORY */ public static FeatureTypeFactory getFeatureTypeFactory(Hints hints) { hints = mergeSystemHints(hints); return (FeatureTypeFactory) lookup(FeatureTypeFactory.class, hints, Hints.FEATURE_TYPE_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 FeatureCollections getFeatureCollections(Hints hints) { hints = mergeSystemHints(hints); return (FeatureCollections) lookup(FeatureCollections.class, 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 * @deprecated FeautreLockFactory is no longer needed; please create a FeatureLock directly */ public static FeatureLockFactory getFeatureLockFactory(Hints hints) { hints = mergeSystemHints(hints); return (FeatureLockFactory) lookup(FeatureLockFactory.class, hints, Hints.FEATURE_LOCK_FACTORY); }
/** * Return the first implementation of {@link FeatureFactory} matching the specified hints. * * <p>If no implementation matches, a new one is created if possible or an exception is thrown. * * @param hints An optional map of hints; or {@code null} if none * @return Instance of FeatureFactory matching the supplied hints * @throws FactoryRegistryException if no implementation could be provided * @see Hints#FEATURE_FACTORY */ public static FeatureFactory getFeatureFactory(Hints hints) { hints = mergeSystemHints(hints); if (hints.get(Hints.FEATURE_FACTORY) == null) { try { Class<?> lenient = Class.forName("org.geotools.feature.LenientFeatureFactoryImpl"); hints.put(Hints.FEATURE_FACTORY, lenient); } catch (ClassNotFoundException e) { java.util.logging.Logger.getGlobal().log(java.util.logging.Level.INFO, "", e); } } return (FeatureFactory) lookup(FeatureFactory.class, hints, Hints.FEATURE_FACTORY); }