* @param expression The given argument expression.
* @param functionsByName The custom valang functions.
* @return The parsed function.
*/
protected Function parseFunction(String expression, Map functionsByName) {
ValangParser parser = new ValangParser(new StringReader(expression));
parser.setFunctionsByName(functionsByName);
try {
return parser.function(new TargetBeanFunction());
} catch (ParseException pe) {
logger.error("Could not parse valang expression '" + expression + "' to a function", pe);
throw new IllegalArgumentException("Could not parse valang expression '" + expression + "' to a function");
}
}