/** * Factory that make the correct decorator for the provided featureSource. * * <p>This factory method is public and will be used to create all required subclasses. By * comparison the constructors for this class have package visibility. * * @param featureSource * @param settings Settings for this store */ public static GeoServerFeatureSource create( FeatureSource<SimpleFeatureType, SimpleFeature> featureSource, Settings settings) { if (featureSource instanceof FeatureLocking) { return new GeoServerFeatureLocking( (FeatureLocking<SimpleFeatureType, SimpleFeature>) featureSource, settings); } else if (featureSource instanceof FeatureStore) { return new GeoServerFeatureStore( (FeatureStore<SimpleFeatureType, SimpleFeature>) featureSource, settings); } return new GeoServerFeatureSource(featureSource, settings); }