Codota Logo
MVELInterpretedRuntime
Code IndexAdd Codota to your IDE (free)

How to use
MVELInterpretedRuntime
in
org.mvel2

Best Java code snippets using org.mvel2.MVELInterpretedRuntime (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ArrayList a =
  • Codota Iconnew ArrayList<String>()
  • Codota Iconnew ArrayList()
  • Codota Iconnew ArrayList<Object>()
  • Smart code suggestions by Codota
}
origin: org.mvel/mvel2

/**
 * Evaluate an expression against a context object and return the value
 *
 * @param expression A char[] containing the expression to be evaluated.
 * @param ctx        The context object to evaluate against
 * @param vars       The variables to be injected
 * @return The resultant value
 * @see #eval(String, Object, VariableResolverFactory)
 */
public static Object eval(char[] expression, Object ctx, VariableResolverFactory vars) {
 return new MVELInterpretedRuntime(expression, ctx, vars).parse();
}
origin: org.mvel/mvel2

reduceRight();
 if (unwindStatement(operator)) {
  return -1;
reduceRight();
 if (unwindStatement(operator)) {
  return OP_TERMINATE;
  if ((tk = nextToken()) == null || tk.isOperator(Operator.TERNARY_ELSE))
   break;
captureToEOS();
return OP_RESET_FRAME;
if (hasMore()) {
 holdOverRegister = stk.pop();
 stk.clear();
origin: org.mvel/mvel2

while ((tk = nextToken()) != null) {
 holdOverRegister = null;
   Object o = stk.peek();
   if (o instanceof Integer) {
    arithmeticFunctionReduction((Integer) o);
  if (tk instanceof Substatement && (tk = nextToken()) != null) {
   if (isArithmeticOperator(operator = tk.getOperator())) {
    stk.push(nextToken().getReducedValue(ctx, ctx, variableFactory), operator);
    if (procBooleanOperator(arithmeticFunctionReduction(operator)) == -1)
     return stk.peek();
    else
 switch (procBooleanOperator(operator = tk.getOperator())) {
  case RETURN:
   variableFactory.setTiltFlag(true);
 stk.push(nextToken().getReducedValue(ctx, ctx, variableFactory), operator);
 switch ((operator = arithmeticFunctionReduction(operator))) {
  case OP_TERMINATE:
   return stk.peek();
 if (procBooleanOperator(operator) == OP_TERMINATE) return stk.peek();
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.mvel

MVELInterpretedRuntime runtime = new MVELInterpretedRuntime(inBuffer.toString(), ctxObject, lvrf);
runtime.newContext(pCtx);
outputBuffer = runtime.parse();
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.mvel

public Object parse() {
  try {
    stk = new ExecutionStack();
    dStack = new ExecutionStack();
    cursor = 0;
    return parseAndExecuteInterpreted();
  }
  catch (ArrayIndexOutOfBoundsException e) {
    e.printStackTrace();
    throw new ParseException("unexpected end of statement", expr, length);
  }
  catch (NullPointerException e) {
    e.printStackTrace();
    if (cursor >= length) {
      throw new ParseException("unexpected end of statement", expr, length);
    }
    else {
      throw e;
    }
  }
  catch (EndWithValue end) {
    return end.getValue();
  }
  finally {
    if (parserContext != null) contextControl(REMOVE, null, null);
  }
}
origin: org.mvel/mvel2

/**
 * This method peforms the equivilent of an XSWAP operation to flip the operator
 * over to the top of the stack, and loads the stored values on the d-stack onto
 * the main program stack.
 */
private void reduceRight() {
 if (dStack.isEmpty()) return;
 Object o = stk.pop();
 stk.push(dStack.pop(), o, dStack.pop());
 reduce();
}
origin: io.virtdata/virtdata-lib-realer

/**
 * This method is called to unwind the current statement without any reduction or further parsing.
 *
 * @param operator -
 * @return -
 */
private boolean unwindStatement(int operator) {
 ASTNode tk;
 switch (operator) {
  case AND:
   while ((tk = nextToken()) != null && !tk.isOperator(Operator.END_OF_STMT) && !tk.isOperator(Operator.OR)) {
    //nothing
   }
   break;
  default:
   while ((tk = nextToken()) != null && !tk.isOperator(Operator.END_OF_STMT)) {
    //nothing
   }
 }
 return tk == null;
}
origin: io.virtdata/virtdata-lib-realer

public Object parse() {
 try {
  stk = new ExecutionStack();
  dStack = new ExecutionStack();
  variableFactory.setTiltFlag(false);
  cursor = start;
  return parseAndExecuteInterpreted();
 }
 catch (ArrayIndexOutOfBoundsException e) {
  e.printStackTrace();
  throw new CompileException("unexpected end of statement", expr, length);
 }
 catch (NullPointerException e) {
  e.printStackTrace();
  if (cursor >= length) {
   throw new CompileException("unexpected end of statement", expr, length);
  }
  else {
   throw e;
  }
 }
 catch (CompileException e) {
  throw ErrorUtil.rewriteIfNeeded(e, expr, cursor);
 }
}
origin: io.virtdata/virtdata-lib-realer

reduceRight();
 if (unwindStatement(operator)) {
  return -1;
reduceRight();
 if (unwindStatement(operator)) {
  return OP_TERMINATE;
  if ((tk = nextToken()) == null || tk.isOperator(Operator.TERNARY_ELSE))
   break;
captureToEOS();
return OP_RESET_FRAME;
if (hasMore()) {
 holdOverRegister = stk.pop();
 stk.clear();
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.mvel

while ((tk = nextToken()) != null) {
  holdOverRegister = null;
    if (tk instanceof Substatement && (tk = nextToken()) != null) {
      if (isArithmeticOperator(operator = tk.getOperator())) {
        stk.push(nextToken().getReducedValue(ctx, ctx, variableFactory), operator);
        if (procBooleanOperator(arithmeticFunctionReduction(operator)) == -1)
          return stk.peek();
        else
  switch (procBooleanOperator(operator = tk.getOperator())) {
    case OP_TERMINATE:
      return stk.peek();
  stk.push(nextToken().getReducedValue(ctx, ctx, variableFactory), operator);
  switch ((operator = arithmeticFunctionReduction(operator))) {
    case OP_TERMINATE:
      return stk.peek();
  if (procBooleanOperator(operator) == -1) return stk.peek();
origin: io.virtdata/virtdata-lib-realer

/**
 * This method peforms the equivilent of an XSWAP operation to flip the operator
 * over to the top of the stack, and loads the stored values on the d-stack onto
 * the main program stack.
 */
private void reduceRight() {
 if (dStack.isEmpty()) return;
 Object o = stk.pop();
 stk.push(dStack.pop(), o, dStack.pop());
 reduce();
}
origin: org.mvel/mvel2

/**
 * This method is called to unwind the current statement without any reduction or further parsing.
 *
 * @param operator -
 * @return -
 */
private boolean unwindStatement(int operator) {
 ASTNode tk;
 switch (operator) {
  case AND:
   while ((tk = nextToken()) != null && !tk.isOperator(Operator.END_OF_STMT) && !tk.isOperator(Operator.OR)) {
    //nothing
   }
   break;
  default:
   while ((tk = nextToken()) != null && !tk.isOperator(Operator.END_OF_STMT)) {
    //nothing
   }
 }
 return tk == null;
}
origin: org.mvel/mvel2

public Object parse() {
 try {
  stk = new ExecutionStack();
  dStack = new ExecutionStack();
  variableFactory.setTiltFlag(false);
  cursor = start;
  return parseAndExecuteInterpreted();
 }
 catch (ArrayIndexOutOfBoundsException e) {
  e.printStackTrace();
  throw new CompileException("unexpected end of statement", expr, length);
 }
 catch (NullPointerException e) {
  e.printStackTrace();
  if (cursor >= length) {
   throw new CompileException("unexpected end of statement", expr, length);
  }
  else {
   throw e;
  }
 }
 catch (CompileException e) {
  throw ErrorUtil.rewriteIfNeeded(e, expr, cursor);
 }
}
origin: org.mvel/mvel2

/**
 * Evaluate an expression against a context object and return the value
 *
 * @param expression A char[] containing the expression to be evaluated.
 * @param ctx        The context object to evaluate against
 * @return The resultant value
 * @see #eval(String, Object)
 */
public static Object eval(char[] expression, Object ctx) {
 return new MVELInterpretedRuntime(expression, ctx).parse();
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.mvel

reduceRight();
  if (unwindStatement(operator)) {
    return -1;
reduceRight();
  if (unwindStatement(operator)) {
    return -1;
  while ((tk = nextToken()) != null && !tk.isOperator(Operator.TERNARY_ELSE)) {
captureToEOS();
return 0;
if (hasMore()) {
  holdOverRegister = stk.pop();
  stk.clear();
origin: io.virtdata/virtdata-lib-realer

while ((tk = nextToken()) != null) {
 holdOverRegister = null;
   Object o = stk.peek();
   if (o instanceof Integer) {
    arithmeticFunctionReduction((Integer) o);
  if (tk instanceof Substatement && (tk = nextToken()) != null) {
   if (isArithmeticOperator(operator = tk.getOperator())) {
    stk.push(nextToken().getReducedValue(ctx, ctx, variableFactory), operator);
    if (procBooleanOperator(arithmeticFunctionReduction(operator)) == -1)
     return stk.peek();
    else
 switch (procBooleanOperator(operator = tk.getOperator())) {
  case RETURN:
   variableFactory.setTiltFlag(true);
 stk.push(nextToken().getReducedValue(ctx, ctx, variableFactory), operator);
 switch ((operator = arithmeticFunctionReduction(operator))) {
  case OP_TERMINATE:
   return stk.peek();
 if (procBooleanOperator(operator) == OP_TERMINATE) return stk.peek();
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.mvel

/**
 * This method peforms the equivilent of an XSWAP operation to flip the operator
 * over to the top of the stack, and loads the stored values on the d-stack onto
 * the main program stack.
 */
private void reduceRight() {
  if (dStack.isEmpty()) return;
  Object o = stk.pop();
  stk.push(dStack.pop());
  stk.push(o);
  stk.push(dStack.pop());
  reduce();
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.mvel

/**
 * This method is called to unwind the current statement without any reduction or further parsing.
 *
 * @param operator -
 * @return -
 */
private boolean unwindStatement(int operator) {
  ASTNode tk;
  switch (operator) {
    case AND:
      while ((tk = nextToken()) != null && !tk.isOperator(Operator.END_OF_STMT) && !tk.isOperator(Operator.OR)) {
        //nothing
      }
      break;
    default:
      while ((tk = nextToken()) != null && !tk.isOperator(Operator.END_OF_STMT)) {
        //nothing
      }
  }
  return tk == null;
}
origin: org.mvel/mvel2

/**
 * Evaluate an expression against a context object and return the value
 *
 * @param expression A char[] containing the expression to be evaluated.
 * @param ctx        The context object to evaluate against
 * @param vars       A Map of variables to be injected
 * @return The resultant value
 * @see #eval(String, Object, Map)
 */
public static Object eval(char[] expression, Object ctx, Map vars) {
 return new MVELInterpretedRuntime(expression, ctx, vars).parse();
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.mvel

/**
 * Evaluate an expression and return the value.
 *
 * @param expression A String containing the expression to be evaluated.
 * @return the resultant value
 */
public static Object eval(String expression) {
  return new MVELInterpretedRuntime(expression, MVELRuntime.IMMUTABLE_DEFAULT_FACTORY).parse();
}
org.mvel2MVELInterpretedRuntime

Javadoc

The MVEL interpreted runtime, used for fast parse and execution of scripts.

Most used methods

  • <init>
  • arithmeticFunctionReduction
  • captureToEOS
  • hasMore
  • isArithmeticOperator
  • nextToken
  • parse
  • parseAndExecuteInterpreted
    Main interpreter loop.
  • procBooleanOperator
  • reduce
  • reduceRight
    This method peforms the equivilent of an XSWAP operation to flip the operator over to the top of the
  • setExpression
  • reduceRight,
  • setExpression,
  • unwindStatement,
  • contextControl,
  • getParserContext,
  • newContext

Popular in Java

  • Running tasks concurrently on multiple threads
  • getExternalFilesDir (Context)
  • onCreateOptionsMenu (Activity)
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • Collectors (java.util.stream)
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now