Object returnValue,
Throwable exceptionThrown) {
StringBuilder retVal = new StringBuilder(text.length());
//create a JexlContext to be used in all evaluations
JexlContext jexlContext = new HashMapContext();
for (int i = 0; i < args.length; i++) {
jexlContext.getVars().put("$" + i, args[i]);
}
jexlContext.getVars().put("$methodName", methodName);
jexlContext.getVars().put("$this", annotatedObject);
jexlContext.getVars().put("$class", annotatedClass);
jexlContext.getVars().put("$return", returnValue);
jexlContext.getVars().put("$exception", exceptionThrown);
// look for {expression} in the passed in text
int bracketIndex;
int lastCloseBracketIndex = -1;
while ((bracketIndex = text.indexOf('{', lastCloseBracketIndex + 1)) >= 0) {