Beispiel #1
0
 @Override
 public Object get(ErrorHandler errors, Context context, Object root, Object instance) {
   try {
     Object result = left.get(errors, context, root, instance);
     return right.get(errors, context, root, result);
   } catch (Throwable t) {
     throw errors.error(node, t);
   }
 }
Beispiel #2
0
  @Override
  public Object get(ErrorHandler errors, Context context, Object root, Object instance) {
    if (instance == null) {
      throw errors.error(node, "Object is null, can't invoke a method on a null object");
    }

    try {
      Object[] values = new Object[params.length];
      for (int i = 0, n = params.length; i < n; i++) {
        values[i] = params[i].get(errors, context, root, root);
      }

      return method.invoke(instance, values);
    } catch (InvocationTargetException e) {
      throw errors.error(node, "Exception caught while executing: " + e.getMessage(), e);
    } catch (Exception e) {
      throw errors.error(node, e);
    }
  }
Beispiel #3
0
 @Override
 public void set(
     ErrorHandler errors, Context context, Object root, Object instance, Object value) {
   throw errors.error(node, "Can not set value of this expression");
 }