@Test public void testAccept() { Filter filter = ff.and(a, b); final int count[] = new int[1]; filters.accept(filter, new FilterVisitor() { public void visit(org.geotools.filter.Filter filter) { count[0]++; } public void visit(BetweenFilter filter) { count[0]++; } public void visit(CompareFilter filter) { count[0]++; } public void visit(GeometryFilter filter) { count[0]++; } public void visit(LikeFilter filter) { count[0]++; } public void visit(LogicFilter filter) { count[0]++; } public void visit(NullFilter filter) { count[0]++; } public void visit(FidFilter filter) { count[0]++; } public void visit(AttributeExpression expression) { count[0]++; } public void visit(Expression expression) { count[0]++; } public void visit(LiteralExpression expression) { count[0]++; } public void visit(MathExpression expression) { count[0]++; } public void visit(FunctionExpression expression) { count[0]++; } }); assertEquals(1, count[0]); }
public static void accept( org.opengis.filter.Filter filter, FilterVisitor visitor ){ if( filter == Filter.EXCLUDE ){ if( visitor instanceof FilterVisitor2 ){ ((FilterVisitor2)visitor).visit( (ExcludeFilter) Filter.EXCLUDE ); } return; } else if( filter == Filter.INCLUDE ){ if( visitor instanceof FilterVisitor2 ){ ((FilterVisitor2)visitor).visit( (IncludeFilter) Filter.INCLUDE); } return; } if( filter instanceof org.geotools.filter.Filter ){ ((org.geotools.filter.Filter) filter).accept( visitor ); } else { if( STRICT ){ throw new ClassCastException("Please update your code to a org.opengis.filter.FilterVisitor"); } FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null); DuplicatingFilterVisitor xerox = new DuplicatingFilterVisitor( ff ); org.geotools.filter.Filter copy = (org.geotools.filter.Filter) filter.accept( xerox, ff ); copy.accept(visitor); } }
Filters { public static void accept( org.opengis.filter.Filter filter, FilterVisitor visitor ){ if( filter == Filter.EXCLUDE ){ if( visitor instanceof FilterVisitor2 ){ ((FilterVisitor2)visitor).visit( (ExcludeFilter) Filter.EXCLUDE ); } return; } else if( filter == Filter.INCLUDE ){ if( visitor instanceof FilterVisitor2 ){ ((FilterVisitor2)visitor).visit( (IncludeFilter) Filter.INCLUDE); } return; } if( filter instanceof org.geotools.filter.Filter ){ ((org.geotools.filter.Filter) filter).accept( visitor ); } else { if( STRICT ){ throw new ClassCastException("Please update your code to a org.opengis.filter.FilterVisitor"); } FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null); DuplicatingFilterVisitor xerox = new DuplicatingFilterVisitor( ff ); org.geotools.filter.Filter copy = (org.geotools.filter.Filter) filter.accept( xerox, ff ); copy.accept(visitor); } } }
Filters { public static void accept( org.opengis.filter.Filter filter, FilterVisitor visitor ){ if( filter == Filter.EXCLUDE ){ if( visitor instanceof FilterVisitor2 ){ ((FilterVisitor2)visitor).visit( (ExcludeFilter) Filter.EXCLUDE ); } return; } else if( filter == Filter.INCLUDE ){ if( visitor instanceof FilterVisitor2 ){ ((FilterVisitor2)visitor).visit( (IncludeFilter) Filter.INCLUDE); } return; } if( filter instanceof org.geotools.filter.Filter ){ ((org.geotools.filter.Filter) filter).accept( visitor ); } else { if( STRICT ){ throw new ClassCastException("Please update your code to a org.opengis.filter.FilterVisitor"); } FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null); DuplicatingFilterVisitor xerox = new DuplicatingFilterVisitor( ff ); org.geotools.filter.Filter copy = (org.geotools.filter.Filter) filter.accept( xerox, ff ); copy.accept(visitor); } } Filters();  Filters(org.opengis.filter.FilterFactory2 factory); }
Filters { public static void accept( org.opengis.filter.Filter filter, FilterVisitor visitor ){ if( filter == Filter.EXCLUDE ){ if( visitor instanceof FilterVisitor2 ){ ((FilterVisitor2)visitor).visit( (ExcludeFilter) Filter.EXCLUDE ); } return; } else if( filter == Filter.INCLUDE ){ if( visitor instanceof FilterVisitor2 ){ ((FilterVisitor2)visitor).visit( (IncludeFilter) Filter.INCLUDE); } return; } if( filter instanceof org.geotools.filter.Filter ){ ((org.geotools.filter.Filter) filter).accept( visitor ); } else { if( STRICT ){ throw new ClassCastException("Please update your code to a org.opengis.filter.FilterVisitor"); } FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null); DuplicatingFilterVisitor xerox = new DuplicatingFilterVisitor( ff ); org.geotools.filter.Filter copy = (org.geotools.filter.Filter) filter.accept( xerox, ff ); copy.accept(visitor); } } Filters();  Filters(org.opengis.filter.FilterFactory2 factory); void setFilterFactory(org.opengis.filter.FilterFactory2 factory); static Filter and( org.opengis.filter.FilterFactory ff, Filter filter1, Filter filter2 ); static Filter or( org.opengis.filter.FilterFactory ff, Filter filter1, Filter filter2 ); static void accept( org.opengis.filter.Filter filter, FilterVisitor visitor ); Filter duplicate( Filter filter ); static short getFilterType( org.opengis.filter.Filter filter ); static int asInt( Expression expr ); static String asString(Expression expr); static double asDouble(Expression expr); static T asType(Expression expr, Class<T> TYPE); static double number(Object value); static T gets(String text, Class<T> TYPE); static String puts(double number); static String puts(Object obj); static String puts(Color color); Filter remove(Filter baseFilter, Filter targetFilter); static Filter removeFilter( Filter baseFilter, Filter targetFilter ); Filter remove(Filter baseFilter, final Filter targetFilter, boolean recurse); static Filter removeFilter(Filter baseFilter, Filter targetFilter, boolean recurse); Set<String> attributeNames( Filter filter ); static String[] attributeNames(Filter filter, final SimpleFeatureType featureType); static Set<PropertyName> propertyNames(Filter filter, final SimpleFeatureType featureType); static Set<PropertyName> propertyNames(Filter filter); static Set<PropertyName> propertyNames(Expression expression,
            final SimpleFeatureType featureType); static Set<PropertyName> propertyNames(Expression expression); static boolean hasChildren( Filter filter ); static ArrayList<Filter> children( Filter filter ); static ArrayList<Filter> children( Filter filter, boolean all ); static T search(Filter filter, Class<T> filterType, String propertyName ); static String findPropertyName(Filter filter); }
Filters { public static void accept( org.opengis.filter.Filter filter, FilterVisitor visitor ){ if( filter == Filter.EXCLUDE ){ if( visitor instanceof FilterVisitor2 ){ ((FilterVisitor2)visitor).visit( (ExcludeFilter) Filter.EXCLUDE ); } return; } else if( filter == Filter.INCLUDE ){ if( visitor instanceof FilterVisitor2 ){ ((FilterVisitor2)visitor).visit( (IncludeFilter) Filter.INCLUDE); } return; } if( filter instanceof org.geotools.filter.Filter ){ ((org.geotools.filter.Filter) filter).accept( visitor ); } else { if( STRICT ){ throw new ClassCastException("Please update your code to a org.opengis.filter.FilterVisitor"); } FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null); DuplicatingFilterVisitor xerox = new DuplicatingFilterVisitor( ff ); org.geotools.filter.Filter copy = (org.geotools.filter.Filter) filter.accept( xerox, ff ); copy.accept(visitor); } } Filters();  Filters(org.opengis.filter.FilterFactory2 factory); void setFilterFactory(org.opengis.filter.FilterFactory2 factory); static Filter and( org.opengis.filter.FilterFactory ff, Filter filter1, Filter filter2 ); static Filter or( org.opengis.filter.FilterFactory ff, Filter filter1, Filter filter2 ); static void accept( org.opengis.filter.Filter filter, FilterVisitor visitor ); Filter duplicate( Filter filter ); static short getFilterType( org.opengis.filter.Filter filter ); static int asInt( Expression expr ); static String asString(Expression expr); static double asDouble(Expression expr); static T asType(Expression expr, Class<T> TYPE); static double number(Object value); static T gets(String text, Class<T> TYPE); static String puts(double number); static String puts(Object obj); static String puts(Color color); Filter remove(Filter baseFilter, Filter targetFilter); static Filter removeFilter( Filter baseFilter, Filter targetFilter ); Filter remove(Filter baseFilter, final Filter targetFilter, boolean recurse); static Filter removeFilter(Filter baseFilter, Filter targetFilter, boolean recurse); Set<String> attributeNames( Filter filter ); static String[] attributeNames(Filter filter, final SimpleFeatureType featureType); static Set<PropertyName> propertyNames(Filter filter, final SimpleFeatureType featureType); static Set<PropertyName> propertyNames(Filter filter); static Set<PropertyName> propertyNames(Expression expression,
            final SimpleFeatureType featureType); static Set<PropertyName> propertyNames(Expression expression); static boolean hasChildren( Filter filter ); static ArrayList<Filter> children( Filter filter ); static ArrayList<Filter> children( Filter filter, boolean all ); static T search(Filter filter, Class<T> filterType, String propertyName ); static String findPropertyName(Filter filter); static final int NOTFOUND; }