@Test public void testFallback() { parameters.add(ff2.literal("abc12_67")); parameters.add(ff2.literal(".*(\\d{3})_(\\d{3})")); parameters.add(ff2.literal("first${1}_second${2}_full${0}")); parameters.add(ff2.literal("noMatch")); Function fn = finder.findFunction("stringTemplate", parameters, fallback); Object result = fn.evaluate(null); assertEquals("noMatch", result); }
public Object evaluate(Object object) { return evaluate(object, Object.class); }
StringTemplateFunction implements Function { public Object evaluate(Object object) { return evaluate(object, Object.class); } }
StringTemplateFunction implements Function { public Object evaluate(Object object) { return evaluate(object, Object.class); } StringTemplateFunction();  StringTemplateFunction(List<Expression> parameters, Literal fallback); }
StringTemplateFunction implements Function { public Object evaluate(Object object) { return evaluate(object, Object.class); } StringTemplateFunction();  StringTemplateFunction(List<Expression> parameters, Literal fallback); String getName(); FunctionName getFunctionName(); List<Expression> getParameters(); Object accept(ExpressionVisitor visitor, Object extraData); Object evaluate(Object object); T evaluate(Object object, Class<T> context); Literal getFallbackValue(); @Override String toString(); }
StringTemplateFunction implements Function { public Object evaluate(Object object) { return evaluate(object, Object.class); } StringTemplateFunction();  StringTemplateFunction(List<Expression> parameters, Literal fallback); String getName(); FunctionName getFunctionName(); List<Expression> getParameters(); Object accept(ExpressionVisitor visitor, Object extraData); Object evaluate(Object object); T evaluate(Object object, Class<T> context); Literal getFallbackValue(); @Override String toString(); static final FunctionName NAME; }