@Test public void testEvaluateFeature() throws Exception{ SimpleFeatureType type = DataUtilities.createType("ns", "name:string,geom:Geometry"); SimpleFeatureBuilder build = new SimpleFeatureBuilder(type); build.add("testName"); build.add(null); SimpleFeature feature = build.buildFeature(null); f.setParameters(Collections.singletonList(ff.property("nonExistant"))); Assert.assertEquals(Boolean.FALSE, f.evaluate(feature)); f.setParameters(Collections.singletonList(ff.property("name"))); Assert.assertEquals(Boolean.TRUE, f.evaluate(feature)); f.setParameters(Collections.singletonList(ff.property("geom"))); Assert.assertEquals(Boolean.TRUE, f.evaluate(feature)); }
public Object evaluate(SimpleFeature feature) { String propName = getPropertyName(); AttributeDescriptor attributeType = feature.getFeatureType().getDescriptor(propName); return Boolean.valueOf(attributeType != null); }
PropertyExistsFunction extends FunctionExpressionImpl { public Object evaluate(SimpleFeature feature) { String propName = getPropertyName(); AttributeDescriptor attributeType = feature.getFeatureType().getDescriptor(propName); return Boolean.valueOf(attributeType != null); } }
PropertyExistsFunction extends FunctionExpressionImpl { public Object evaluate(SimpleFeature feature) { String propName = getPropertyName(); AttributeDescriptor attributeType = feature.getFeatureType().getDescriptor(propName); return Boolean.valueOf(attributeType != null); } PropertyExistsFunction(); }
PropertyExistsFunction extends FunctionExpressionImpl { public Object evaluate(SimpleFeature feature) { String propName = getPropertyName(); AttributeDescriptor attributeType = feature.getFeatureType().getDescriptor(propName); return Boolean.valueOf(attributeType != null); } PropertyExistsFunction(); Object evaluate(SimpleFeature feature); Object evaluate(Object bean); String toString(); boolean equals(Object obj); }
PropertyExistsFunction extends FunctionExpressionImpl { public Object evaluate(SimpleFeature feature) { String propName = getPropertyName(); AttributeDescriptor attributeType = feature.getFeatureType().getDescriptor(propName); return Boolean.valueOf(attributeType != null); } PropertyExistsFunction(); Object evaluate(SimpleFeature feature); Object evaluate(Object bean); String toString(); boolean equals(Object obj); static FunctionName NAME; }