Beispiel #1
0
  @Override
  public Object marshal(Env env, FeatureExpr ctx, Expr expr, Class argClass) {
    Value value = expr.eval(env, VHelper.noCtx()).getOne();

    return marshalValue(env, ctx, value, argClass);
  }
Beispiel #2
0
 @SuppressWarnings("unchecked")
 public <T> T marshal(Env env, Expr expr, Class<T> expectedClass) {
   return (T) env.lookupPwd(expr.eval(env));
 }
Beispiel #3
0
 public Object marshal(Env env, Expr expr, Class expectedClass) {
   return new Integer((int) expr.evalLong(env));
 }
Beispiel #4
0
 public Object marshal(Env env, Expr expr, Class expectedClass) {
   return new Float((float) expr.evalDouble(env));
 }
Beispiel #5
0
 public Object marshal(Env env, Expr expr, Class expectedClass) {
   return expr.eval(env).toArrayValue(env);
 }
 @Override
 public int getMarshalingCost(Expr expr) {
   if (expr.isArray()) return Marshal.ZERO;
   else return Marshal.ONE;
 }
Beispiel #7
0
 @Override
 public Object marshal(Env env, FeatureExpr ctx, Expr expr, Class expectedClass) {
   return marshalValue(env, ctx, expr.eval(env, VHelper.noCtx()).getOne(), expectedClass);
 }
 public Object marshal(Env env, Expr expr, Class expectedClass) {
   return RegexpModule.createRegexpArray(env, expr.eval(env));
 }
 public Value evalInitExpr(Env env) {
   return _initValue.eval(env).copy();
 }
Beispiel #10
0
  public Object marshal(Env env, Expr expr, Class argClass) {
    String name = expr.evalString(env);

    return Enum.valueOf(_enumClass, name);
  }
Beispiel #11
0
 @Override
 public Object marshal(Env env, FeatureExpr ctx, Expr expr, Class expectedClass) {
   return new Long(expr.evalLong(env, VHelper.noCtx()).getOne());
 }
Beispiel #12
0
 /** Executes the statement, returning the expression value. */
 public Value execute(Env env) {
   if (_target == null) return ContinueValue.CONTINUE;
   else return new ContinueValue(_target.eval(env).toInt());
 }