Package org.mvel2

Examples of org.mvel2.CompileException


    return null;
  }

  public Object getReducedValue(Object ctx, Object thisValue, VariableResolverFactory factory) {
    if (!factory.isResolveable(name)) factory.createVariable(name, null, egressType);
    else throw new CompileException("variable defined within scope: " + name, expr, start);

    return null;
  }
View Full Code Here


        try {
          this.importClass = Class.forName(clsName, true, classLoader );
        }
        catch (ClassNotFoundException e2) {
          throw new CompileException("class not found: " + new String(expr), expr, start);
        }
      }
    }
  }
View Full Code Here

    if (constraintEx != null) {
      Object x = dataEx.getValue(ctx, thisValue, factory);

      if (!(x instanceof Collection))
        throw new CompileException("was expecting type: Collection; but found type: "
            + (x == null ? "null" : x.getClass().getName()), expr, start);

      list = new ArrayList(((Collection) x).size());
      for (Object o : (Collection) x) {
        itemR.value = o;
        if ((Boolean) constraintEx.getValue(ctx, thisValue, itemFactory)) {
          list.add(subEx.getValue(o, thisValue, itemFactory));
        }
      }
    }
    else {
      Object x = dataEx.getValue(ctx, thisValue, factory);

      if (!(x instanceof Collection))
        throw new CompileException("was expecting type: Collection; but found type: "
            + (x == null ? "null" : x.getClass().getName()), expr, start);

      list = new ArrayList(((Collection) x).size());
      for (Object o : (Collection) x) {
        list.add(subEx.getValue(itemR.value = o, thisValue, itemFactory));
View Full Code Here

      if (((fields |= NUMERIC | LITERAL | IDENTIFIER) & INVERT) != 0) {
        try {
          literal = ~((Integer) literal);
        }
        catch (ClassCastException e) {
          throw new CompileException("bitwise (~) operator can only be applied to integers", expr, start);
        }
      }
      return;
    }
View Full Code Here

      // this.start = mark + 1;
      this.start = skipWhitespace(expr, mark + 1);

      if (this.start >= start + offset) {
        throw new CompileException("unexpected end of statement", expr, mark + 1);
      }

      this.offset = offset - (this.start - start);

      if ((fields & COMPILE_IMMEDIATE) != 0) {
View Full Code Here

      if (pCtx != null) {
        pCtx.setInputs(spCtx.getInputs());
      }
    }
    catch (NegativeArraySizeException e) {
      throw new CompileException("wrong syntax; did you mean to use 'foreach'?", expr, start);
    }
    return varsEscape;
  }
View Full Code Here

  private static int nextCondPart(char[] condition, int cursor, int end, boolean allowEnd) {
    for (; cursor < end; cursor++) {
      if (condition[cursor] == ';') return ++cursor;
    }
    if (!allowEnd) throw new CompileException("expected ;", condition, cursor);
    return cursor;
  }
View Full Code Here

  public Integer getOperator() {
    return operator;
  }

  public Object getReducedValueAccelerated(Object ctx, Object thisValue, VariableResolverFactory factory) {
    throw new CompileException("illegal use of operator: " + getOperatorSymbol(operator), expr, start);
  }
View Full Code Here

  public Object getReducedValueAccelerated(Object ctx, Object thisValue, VariableResolverFactory factory) {
    throw new CompileException("illegal use of operator: " + getOperatorSymbol(operator), expr, start);
  }

  public Object getReducedValue(Object ctx, Object thisValue, VariableResolverFactory factory) {
    throw new CompileException("illegal use of operator: " + getOperatorSymbol(operator), expr, start);
  }
View Full Code Here

            this.right = new LiteralNode(convert(right.getReducedValueAccelerated(null, null, null), targetType), pCtx);
          } else if ( !(areCompatible(left.getEgressType(), right.getEgressType()) ||
                  (( operation == Operator.EQUAL || operation == Operator.NEQUAL) &&
                     CompatibilityStrategy.areEqualityCompatible(left.getEgressType(), right.getEgressType()))) ) {

            throw new CompileException("incompatible types in statement: " + right.getEgressType()
                    + " (compared from: " + left.getEgressType() + ")",
                    left.getExpr() != null ? left.getExpr() : right.getExpr(),
                    left.getExpr() != null ? left.getStart() : right.getStart());
          }
        }
View Full Code Here

TOP

Related Classes of org.mvel2.CompileException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.