@Test public void testEvaluatePojo() { Citation pojo = new CitationImpl(); f.setParameters(Collections.singletonList(ff.property("edition"))); Assert.assertEquals(Boolean.TRUE, f.evaluate(pojo)); f.setParameters(Collections.singletonList(ff.property("alternateTitles"))); Assert.assertEquals(Boolean.TRUE, f.evaluate(pojo)); f.setParameters(Collections.singletonList(ff.property("AlternateTitles"))); Assert.assertEquals(Boolean.FALSE, f.evaluate(pojo)); f.setParameters(Collections.singletonList(ff.property("nonExistentProperty"))); Assert.assertEquals(Boolean.FALSE, f.evaluate(pojo)); }
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; }