コード例 #1
0
  /** 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());
  }
コード例 #2
0
 private void resolveMethod(MethodArgs args) {
   if (methodResolver != null) {
     methodResolver.resolve(args);
   }
 }