/** Returns a GeoTools query build with the provided attributes and filters */ private Query buildQuery(List<PropertyName> attributes, Filter filter) { if (attributes == null && (filter == null || filter == Filter.INCLUDE)) { return Query.ALL; } else { Query q = new Query(); q.setFilter(filter); // TODO: switch this to property names when possible q.setPropertyNames(flattenNames(attributes)); return q; } }