Пример #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);
  }
Пример #2
0
 @SuppressWarnings("unchecked")
 public <T> T marshal(Env env, Expr expr, Class<T> expectedClass) {
   return (T) env.lookupPwd(expr.eval(env));
 }
Пример #3
0
 public Object marshal(Env env, Expr expr, Class expectedClass) {
   return new Integer((int) expr.evalLong(env));
 }
Пример #4
0
 public Object marshal(Env env, Expr expr, Class expectedClass) {
   return new Float((float) expr.evalDouble(env));
 }
Пример #5
0
 public Object marshal(Env env, Expr expr, Class expectedClass) {
   return expr.eval(env).toArrayValue(env);
 }
Пример #6
0
 @Override
 public int getMarshalingCost(Expr expr) {
   if (expr.isArray()) return Marshal.ZERO;
   else return Marshal.ONE;
 }
Пример #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);
 }
Пример #8
0
 public Object marshal(Env env, Expr expr, Class expectedClass) {
   return RegexpModule.createRegexpArray(env, expr.eval(env));
 }
Пример #9
0
 public Value evalInitExpr(Env env) {
   return _initValue.eval(env).copy();
 }
Пример #10
0
  public Object marshal(Env env, Expr expr, Class argClass) {
    String name = expr.evalString(env);

    return Enum.valueOf(_enumClass, name);
  }
Пример #11
0
 @Override
 public Object marshal(Env env, FeatureExpr ctx, Expr expr, Class expectedClass) {
   return new Long(expr.evalLong(env, VHelper.noCtx()).getOne());
 }
Пример #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());
 }