/** Compiles MethodExpressions */ @Override public void visit(MethodExpression method) { if (method == null) { throw new ArgumentException(METHOD + E_IS_NULL); } LogicalExpression[] parameters = new LogicalExpression[method.getParameters().length]; for (int i = 0; i < parameters.length; i++) { parameters[i] = evaluate(method.getParameters()[i]); } MethodArgs args = new MethodArgs(method.getName()); args.setParameters(parameters); resolveMethod(args); // If an external implementation was found get the result back if (args.getResult() != null) { result.setResult((LogicalExpression) args.getResult()); return; } defaultMethodResolver.resolve(args); result.setResult((LogicalExpression) args.getResult()); }
private void resolveMethod(MethodArgs args) { if (methodResolver != null) { methodResolver.resolve(args); } }