@Test public void testGetFeatureReaderQuery() throws Exception { FilterFactory ff = CommonFactoryFinder.getFilterFactory(null); PropertyName property = ff.property("sample/measurement[1]/parameter"); Literal literal = ff.literal("ph"); Filter filterParameter = ff.equals(property, literal); property = ff.property("sample/measurement[1]/value"); literal = ff.literal(Integer.valueOf(3)); Filter filterValue = ff.equals(property, literal); Filter filter = ff.and(filterParameter, filterValue); FeatureSource<FeatureType, Feature> complexSource = dataStore.getFeatureSource(targetName); FeatureCollection<FeatureType, Feature> features = complexSource.getFeatures(filter); FeatureIterator<Feature> reader = features.features(); PropertyIsEqualTo equivalentSourceFilter = ff.equals(ff.property("ph"), ff.literal(Integer.valueOf(3))); FeatureCollection<?, ?> collection = mapping.getSource().getFeatures(equivalentSourceFilter); int count = 0; int expectedCount = collection.size(); Filter badFilter = ff.greater( ff.property("sample/measurement[1]/value"), ff.literal(Integer.valueOf(3))); while (reader.hasNext()) { Feature f = (Feature) reader.next(); assertNotNull(f); assertTrue(filter.evaluate(f)); assertFalse(badFilter.evaluate(f)); count++; } reader.close(); assertEquals(expectedCount, count); }
public FeatureSource<FeatureType, Feature> getFeatureSource(Name typeName) throws IOException { return new MappingFeatureSource(this, getMappingByNameOrElement(typeName)); }
AppSchemaDataAccess implements DataAccess<FeatureType, Feature> { public FeatureSource<FeatureType, Feature> getFeatureSource(Name typeName) throws IOException { return new MappingFeatureSource(this, getMappingByNameOrElement(typeName)); } }
AppSchemaDataAccess implements DataAccess<FeatureType, Feature> { public FeatureSource<FeatureType, Feature> getFeatureSource(Name typeName) throws IOException { return new MappingFeatureSource(this, getMappingByNameOrElement(typeName)); } AppSchemaDataAccess(Set<FeatureTypeMapping> mappings);  AppSchemaDataAccess(Set<FeatureTypeMapping> mappings, boolean hidden); }
AppSchemaDataAccess implements DataAccess<FeatureType, Feature> { public FeatureSource<FeatureType, Feature> getFeatureSource(Name typeName) throws IOException { return new MappingFeatureSource(this, getMappingByNameOrElement(typeName)); } AppSchemaDataAccess(Set<FeatureTypeMapping> mappings);  AppSchemaDataAccess(Set<FeatureTypeMapping> mappings, boolean hidden); Name[] getTypeNames(); FeatureType getSchema(Name typeName); FeatureTypeMapping getMappingByName(Name typeName); FeatureTypeMapping getMappingByNameOrElement(Name typeName); boolean hasName(Name name); boolean hasElement(Name typeName); @SuppressWarnings("unchecked") Query unrollQuery(Query query, FeatureTypeMapping mapping); static boolean matchProperty(StepList requestedProperty, StepList target); static boolean matchProperty(String requestedProperty, StepList target); static Filter unrollFilter(Filter complexFilter, FeatureTypeMapping mapping); void dispose(); ServiceInfo getInfo(); List<Name> getNames(); void createSchema(FeatureType featureType); FeatureSource<FeatureType, Feature> getFeatureSource(Name typeName); void updateSchema(Name typeName, FeatureType featureType); void removeSchema(Name typeName); FeatureSource<FeatureType, Feature> getFeatureSourceByName(Name typeName); Feature findFeature(FeatureId id, Hints hints); }
AppSchemaDataAccess implements DataAccess<FeatureType, Feature> { public FeatureSource<FeatureType, Feature> getFeatureSource(Name typeName) throws IOException { return new MappingFeatureSource(this, getMappingByNameOrElement(typeName)); } AppSchemaDataAccess(Set<FeatureTypeMapping> mappings);  AppSchemaDataAccess(Set<FeatureTypeMapping> mappings, boolean hidden); Name[] getTypeNames(); FeatureType getSchema(Name typeName); FeatureTypeMapping getMappingByName(Name typeName); FeatureTypeMapping getMappingByNameOrElement(Name typeName); boolean hasName(Name name); boolean hasElement(Name typeName); @SuppressWarnings("unchecked") Query unrollQuery(Query query, FeatureTypeMapping mapping); static boolean matchProperty(StepList requestedProperty, StepList target); static boolean matchProperty(String requestedProperty, StepList target); static Filter unrollFilter(Filter complexFilter, FeatureTypeMapping mapping); void dispose(); ServiceInfo getInfo(); List<Name> getNames(); void createSchema(FeatureType featureType); FeatureSource<FeatureType, Feature> getFeatureSource(Name typeName); void updateSchema(Name typeName, FeatureType featureType); void removeSchema(Name typeName); FeatureSource<FeatureType, Feature> getFeatureSourceByName(Name typeName); Feature findFeature(FeatureId id, Hints hints);  }