/** * 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 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); } /**
/** * 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); }
/** * 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 a set of all available implementations for the {@link FeatureLockFactory} interface. * * @param hints An optional map of hints, or {@code null} if none. * @return Set<FeatureLockFactory> of available style factory implementations. * @deprecated FeatureLockFactory is no longer needed */ public static synchronized Set<FeatureLockFactory> getFeatureLockFactories(Hints hints) { hints = mergeSystemHints(hints); return new LazySet<FeatureLockFactory>( getServiceRegistry().getFactories(FeatureLockFactory.class, null, hints)); }
/** * Returns a set of all available implementations for the {@link Function} interface. * * @param hints An optional map of hints, or {@code null} if none. * @return Set of available function expression implementations. */ public static synchronized Set<Function> getFunctions(Hints hints) { hints = mergeSystemHints(hints); return new LazySet<Function>( getServiceRegistry().getFactories(Function.class, null, hints)); }
/** * Returns a set of all available implementations for the {@link FeatureCollections} interface. * * @param hints An optional map of hints, or {@code null} if none. * @return Set of available feature collections implementations. */ public static synchronized Set<FeatureCollections> getFeatureCollectionsSet(Hints hints) { hints = mergeSystemHints(hints); return new LazySet<FeatureCollections>( getServiceRegistry().getFactories(FeatureCollections.class, null, hints)); }
/** * Returns a set of all available implementations for the {@link FilterFactory} interface. * * @param hints An optional map of hints, or {@code null} if none. * @return Set of available filter factory implementations. */ public static synchronized Set<FilterFactory> getFilterFactories(Hints hints) { hints = mergeSystemHints(hints); return new LazySet<FilterFactory>( getServiceRegistry().getFactories(FilterFactory.class, null, hints)); }
/** * Returns a set of all available implementations for the {@link StyleFactory} interface. * * @param hints An optional map of hints, or {@code null} if none. * @return Set of available style factory implementations. */ public static synchronized Set<StyleFactory> getStyleFactories(Hints hints) { hints = mergeSystemHints(hints); return new LazySet<StyleFactory>( getServiceRegistry().getFactories(StyleFactory.class, null, hints)); }
/** * Returns a set of all available implementations of {@link FunctionFactory}. * * @param hints An optional map of hints, or {@code null} if none. * @return Set of available function factory implementations. */ public static synchronized Set<FunctionFactory> getFunctionFactories(Hints hints) { hints = mergeSystemHints(hints); return new LazySet<FunctionFactory>( getServiceRegistry().getFactories(FunctionFactory.class, null, hints)); }
/** * Returns a set of all available implementations for the {@link FileDataStoreFactorySpi} * interface. * * @param hints An optional map of hints, or {@code null} if none. * @return Set of available file data store factory implementations. */ public static synchronized Set<FileDataStoreFactorySpi> getFileDataStoreFactories(Hints hints) { hints = mergeSystemHints(hints); return new LazySet<FileDataStoreFactorySpi>( getServiceRegistry().getFactories(FileDataStoreFactorySpi.class, null, hints)); }
/** * 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); }
/** * Returns the first implementation of {@link FilterFactory2} matching the specified hints. This * is a convenience method invoking {@link #getFilterFactory} with a hint value set for * requerying a {@link FactoryFilter2} implementation. * * @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 FilterFactory2} interface. * @see Hints#FILTER_FACTORY */ public static FilterFactory2 getFilterFactory2(Hints hints) throws FactoryRegistryException { hints = mergeSystemHints(hints); final Object h = hints.get(Hints.FILTER_FACTORY); if (!(h instanceof Class ? FilterFactory2.class.isAssignableFrom((Class<?>) h) : h instanceof FilterFactory2)) { /* * Add the hint value only if the user didn't provided a suitable hint. * In any case, do not change the user-supplied hints; clone them first. */ hints = new Hints(hints); hints.put(Hints.FILTER_FACTORY, FilterFactory2.class); } return (FilterFactory2) getFilterFactory(hints); } /**
/** * Returns a set of all available implementations for the {@link FileDataStoreFactorySpi} interface. * * @param hints An optional map of hints, or {@code null} if none. * @return Set of available file data store factory implementations. */ public static synchronized Set getFileDataStoreFactories(Hints hints) { hints = mergeSystemHints(hints); return new LazySet(getServiceRegistry().getServiceProviders( FileDataStoreFactorySpi.class, null, hints)); }
/** * Returns a set of all available implementations for the {@link FeatureCollections} interface. * * @param hints An optional map of hints, or {@code null} if none. * @return Set of available feature collections implementations. */ public static synchronized Set getFeatureCollectionsSet(Hints hints) { hints = mergeSystemHints(hints); return new LazySet(getServiceRegistry().getServiceProviders( FeatureCollections.class, null, hints)); }
/** * Returns a set of all available implementations for the {@link FilterFactory} interface. * * @param hints An optional map of hints, or {@code null} if none. * @return Set of available filter factory implementations. */ public static synchronized Set getFilterFactories(Hints hints) { hints = mergeSystemHints(hints); return new LazySet(getServiceRegistry().getServiceProviders( FilterFactory.class, null, hints)); }
/** * Returns a set of all available implementations for the {@link StyleFactory} interface. * * @param hints An optional map of hints, or {@code null} if none. * @return Set of available style factory implementations. */ public static synchronized Set getStyleFactories(Hints hints) { hints = mergeSystemHints(hints); return new LazySet(getServiceRegistry().getServiceProviders( StyleFactory.class, null, hints)); }
/** * Returns a set of all available implementations for the {@link FunctionExpression} interface. * * @param hints An optional map of hints, or {@code null} if none. * @return Set of available style factory implementations. * @deprecated Use FunctionExpression is now @deprecated */ public static synchronized Set getFunctionExpressions(Hints hints) { hints = mergeSystemHints(hints); return new LazySet(getServiceRegistry().getServiceProviders( Function.class, null, hints)); }
/** * Returns a set of all available implementations for the {@link FunctionExpression} interface. * * @param hints An optional map of hints, or {@code null} if none. * @return Set of available function expression implementations. */ public static synchronized Set getFunctions(Hints hints) { hints = mergeSystemHints(hints); return new LazySet(getServiceRegistry().getServiceProviders( FunctionImpl.class, null, hints)); }