/** * Traverses the filter and returns any encountered property names. * * <p>The feature type is supplied as contexts used to lookup expressions in cases where the * attributeName does not match the actual name of the type. */ public static String[] attributeNames(Filter filter, final SimpleFeatureType featureType) { if (filter == null) { return new String[0]; } FilterAttributeExtractor attExtractor = new FilterAttributeExtractor(featureType); filter.accept(attExtractor, null); String[] attributeNames = attExtractor.getAttributeNames(); return attributeNames; }
/** * Traverses the filter and returns any encountered property names. * * <p>The feature type is supplied as contexts used to lookup expressions in cases where the * attributeName does not match the actual name of the type. */ public static String[] attributeNames(Filter filter, final SimpleFeatureType featureType) { if (filter == null) { return new String[0]; } FilterAttributeExtractor attExtractor = new FilterAttributeExtractor(featureType); filter.accept(attExtractor, null); String[] attributeNames = attExtractor.getAttributeNames(); return attributeNames; }
/** * Traverses the expression and returns any encountered property names. * * <p>The feature type is supplied as contexts used to lookup expressions in cases where the * attributeName does not match the actual name of the type. */ public static String[] attributeNames( Expression expression, final SimpleFeatureType featureType) { if (expression == null) { return new String[0]; } FilterAttributeExtractor attExtractor = new FilterAttributeExtractor(featureType); expression.accept(attExtractor, null); String[] attributeNames = attExtractor.getAttributeNames(); return attributeNames; }
attExtractor = new FilterAttributeExtractor(fullSchema); unsupportedFilter.accept(attExtractor, null); final String[] filterAtts = attExtractor.getAttributeNames(); for (String attName : filterAtts) { if (!columnNames.contains(attName)) {
SimpleFeatureType[] buildQueryAndReturnFeatureTypes( SimpleFeatureType featureType, String[] propertyNames, Filter filter) { SimpleFeatureType[] types = null; if (propertyNames == Query.ALL_NAMES) { return new SimpleFeatureType[] {featureType, featureType}; } else { SimpleFeatureType returnedSchema = SimpleFeatureTypeBuilder.retype(featureType, propertyNames); SimpleFeatureType querySchema = returnedSchema; if (filter != null && !filter.equals(Filter.INCLUDE)) { FilterAttributeExtractor extractor = new FilterAttributeExtractor(featureType); filter.accept(extractor, null); String[] extraAttributes = extractor.getAttributeNames(); if (extraAttributes != null && extraAttributes.length > 0) { List<String> allAttributes = new ArrayList<String>(Arrays.asList(propertyNames)); for (String extraAttribute : extraAttributes) { if (!allAttributes.contains(extraAttribute)) allAttributes.add(extraAttribute); } String[] allAttributeArray = allAttributes.toArray(new String[allAttributes.size()]); querySchema = SimpleFeatureTypeBuilder.retype(getSchema(), allAttributeArray); } } types = new SimpleFeatureType[] {querySchema, returnedSchema}; } return types; }
public void testPropertyNameSet() throws IllegalFilterException { Filter filter = fac.equals(fac.property("testString"), fac.literal("test string data")); Expression expression1 = fac.property("code"); Expression expression2 = fac.function("length", fac.property("identification")); FilterAttributeExtractor extract = new FilterAttributeExtractor(null); Set<String> names = new HashSet<String>(); // used to collect names from expression1, expression2, and filter expression1.accept(extract, names); expression2.accept(extract, names); filter.accept(extract, names); String array[] = extract.getAttributeNames(); Set<String> attributes = extract.getAttributeNameSet(); Set<PropertyName> properties = extract.getPropertyNameSet(); assertEquals(3, array.length); assertEquals(3, attributes.size()); assertEquals(3, properties.size()); } /**
/** * Traverses the filter and returns any encountered property names. * <p> * The feature type is supplied as contexts used to lookup expressions in cases where the * attributeName does not match the actual name of the type. * </p> */ public static String[] attributeNames(Filter filter, final SimpleFeatureType featureType) { if (filter == null) { return new String[0]; } FilterAttributeExtractor attExtractor = new FilterAttributeExtractor(featureType); filter.accept(attExtractor, null); String[] attributeNames = attExtractor.getAttributeNames(); return attributeNames; }
/** * Traverses the filter and returns any encountered property names. * <p> * The feature type is supplied as contexts used to lookup expressions in cases where the * attributeName does not match the actual name of the type. * </p> */ public static String[] attributeNames(Filter filter, final SimpleFeatureType featureType) { if (filter == null) { return new String[0]; } FilterAttributeExtractor attExtractor = new FilterAttributeExtractor(featureType); filter.accept(attExtractor, null); String[] attributeNames = attExtractor.getAttributeNames(); return attributeNames; }
/** * Traverses the filter and returns any encoutered property names. * <p> * The feautre type is supplied as contexts used to lookup expressions in cases where the * attributeName does not match the actual name of the type. * </p> */ public static String[] attributeNames( Filter filter, final FeatureType featureType ) { if (filter == null) { return new String[0]; } FilterAttributeExtractor attExtractor = new FilterAttributeExtractor(featureType); filter.accept(attExtractor, null); String[] attributeNames = attExtractor.getAttributeNames(); return attributeNames; }
/** * Traverses the expression and returns any encountered property names. * <p> * The feature type is supplied as contexts used to lookup expressions in cases where the * attributeName does not match the actual name of the type. * </p> */ public static String[] attributeNames(Expression expression, final SimpleFeatureType featureType) { if (expression == null) { return new String[0]; } FilterAttributeExtractor attExtractor = new FilterAttributeExtractor(featureType); expression.accept(attExtractor, null); String[] attributeNames = attExtractor.getAttributeNames(); return attributeNames; }
/** * Traverses the expression and returns any encoutered property names. * <p> * The feautre type is supplied as contexts used to lookup expressions in cases where the * attributeName does not match the actual name of the type. * </p> */ public static String[] attributeNames(Expression expression, final FeatureType featureType ) { if (expression == null) { return new String[0]; } FilterAttributeExtractor attExtractor = new FilterAttributeExtractor(featureType); expression.accept(attExtractor, null); String[] attributeNames = attExtractor.getAttributeNames(); return attributeNames; }
attExtractor = new FilterAttributeExtractor(fullSchema); unsupportedFilter.accept(attExtractor, null); final String[] filterAtts = attExtractor.getAttributeNames(); for (String attName : filterAtts) { if (!columnNames.contains(attName)) {
SimpleFeatureType[] buildQueryAndReturnFeatureTypes(SimpleFeatureType featureType, String[] propertyNames, Filter filter) { SimpleFeatureType[] types = null; if(propertyNames == Query.ALL_NAMES) { return new SimpleFeatureType[]{featureType, featureType}; } else { SimpleFeatureType returnedSchema = SimpleFeatureTypeBuilder.retype(featureType, propertyNames); SimpleFeatureType querySchema = returnedSchema; if (filter != null && !filter.equals(Filter.INCLUDE)) { FilterAttributeExtractor extractor = new FilterAttributeExtractor(featureType); filter.accept(extractor, null); String[] extraAttributes = extractor.getAttributeNames(); if(extraAttributes != null && extraAttributes.length > 0) { List<String> allAttributes = new ArrayList<String>(Arrays.asList(propertyNames)); for (String extraAttribute : extraAttributes) { if(!allAttributes.contains(extraAttribute)) allAttributes.add(extraAttribute); } String[] allAttributeArray = (String[]) allAttributes.toArray(new String[allAttributes.size()]); querySchema = SimpleFeatureTypeBuilder.retype(getSchema(), allAttributeArray); } } types = new SimpleFeatureType[]{querySchema, returnedSchema}; } return types; }
private SimpleFeatureType[] buildQueryAndReturnFeatureTypes( SimpleFeatureType featureType, String[] propertyNames, Filter filter) { SimpleFeatureType[] types = null; if (propertyNames == Query.ALL_NAMES) { return new SimpleFeatureType[] {featureType, featureType}; } else { SimpleFeatureType returnedSchema = SimpleFeatureTypeBuilder.retype(featureType, propertyNames); SimpleFeatureType querySchema = returnedSchema; if (filter != null && !filter.equals(Filter.INCLUDE)) { FilterAttributeExtractor extractor = new FilterAttributeExtractor(featureType); filter.accept(extractor, null); String[] extraAttributes = extractor.getAttributeNames(); if (extraAttributes != null && extraAttributes.length > 0) { List<String> allAttributes = new ArrayList<String>(Arrays.asList(propertyNames)); for (String extraAttribute : extraAttributes) { if (!allAttributes.contains(extraAttribute)) allAttributes.add(extraAttribute); } String[] allAttributeArray = allAttributes.toArray(new String[allAttributes.size()]); querySchema = SimpleFeatureTypeBuilder.retype(getSchema(), allAttributeArray); } } types = new SimpleFeatureType[] {querySchema, returnedSchema}; } return types; }
Filter filter = query.getFilter(); filter.accept(extractor, null); String[] filterAttnames = extractor.getAttributeNames();
Filter filter = query.getFilter(); filter.accept(extractor, null); String[] filterAttnames = extractor.getAttributeNames();
ecql.accept(filter, null); List<String> invalids = new ArrayList<>(Arrays.asList(filter.getAttributeNames()));
FilterAttributeExtractor extractor = new FilterAttributeExtractor(getSchema()); postFilter.accept(extractor, null); String[] extraAttributes = extractor.getAttributeNames(); if(extraAttributes == null || extraAttributes.length == 0) { querySchema = returnedSchema;