public Object evaluate(Object target, EventBean[] eventsPerStream, boolean isNewData, ExprEvaluatorContext exprEvaluatorContext) {
if (target == null) {
return null;
}
FastMethod method;
if (cache.containsKey(target.getClass())) {
method = cache.get(target.getClass());
}
else {
method = getFastMethod(target.getClass());
cache.put(target.getClass(), method);
}
if (method == null) {
return null;
}
Object[] args = new Object[parameters.length];
for(int i = 0; i < args.length; i++)
{
args[i] = parameters[i].evaluate(eventsPerStream, isNewData, exprEvaluatorContext);
}
try
{
return method.invoke(target, args);
}
catch (InvocationTargetException e)
{
String message = JavaClassHelper.getMessageInvocationTarget(statementName, method.getJavaMethod(), target.getClass().getName(), args, e);
log.error(message, e.getTargetException());
}
return null;
}