use of org.opengis.filter.ValueReference in project geotoolkit by Geomatys.
the class ExpressionReadingTest method testPropertyName3.
@Test
public void testPropertyName3() throws CQLException {
final String cql = "ùth{e_$uglY^_pr@perté";
final Expression obj = CQL.parseExpression(cql);
assertTrue(obj instanceof ValueReference);
final ValueReference expression = (ValueReference) obj;
assertEquals("ùth{e_$uglY^_pr@perté", expression.getXPath());
}
use of org.opengis.filter.ValueReference in project geotoolkit by Geomatys.
the class JavaScriptFunction method apply.
@Override
public Object apply(final Object feature) {
final Bindings bindings = getEngine().createBindings();
for (int i = 1, n = parameters.size(); i < n; i++) {
final ValueReference property = (ValueReference) parameters.get(i);
final Object value = property.apply(feature);
bindings.put(VAR_CHARACTER + property.getXPath(), value);
}
try {
return getCompiled().eval(bindings);
} catch (ScriptException ex) {
Logger.getLogger("org.geotoolkit.filter.function.javascript").log(Level.WARNING, null, ex);
}
return "";
}
Aggregations