Examples of addIndexedInput()


Examples of org.mvel2.ParserContext.addIndexedInput()

        "   foo = k;" +
        "}; \n"
        + "for (i = 0; i < 100000; i++) { foo++; }; foo;";

    ParserContext ctx = ParserContext.create();
    ctx.addIndexedInput(varNames);
    ctx.setIndexAllocation(true);

    SimpleVariableSpaceModel model = VariableSpaceCompiler.compile(expr, ctx);

    Serializable indexCompile = MVEL.compileExpression(expr, ctx);
View Full Code Here

Examples of org.mvel2.ParserContext.addIndexedInput()

        "   foo = add(5,10);" +
        "}; \n"
        + "for (i = 0; i < 100000; i++) { foo++; }; foo;";

    ParserContext ctx = ParserContext.create();
    ctx.addIndexedInput(varNames);
    ctx.setIndexAllocation(true);

    SimpleVariableSpaceModel model = VariableSpaceCompiler.compile(expr, ctx);

    Serializable indexCompile = MVEL.compileExpression(expr, ctx);
View Full Code Here

Examples of org.mvel2.ParserContext.addIndexedInput()

    ParserContext pctx = new ParserContext( conf );
    pctx.setIndexAllocation( true );
    pctx.setStrictTypeEnforcement(true);
    pctx.setStrongTyping(true);
    pctx.addInput("array", Double[][].class);
    pctx.addIndexedInput("array");
    Map vars = new HashMap() {{ put("array", new Double[2][2]); }};
    assertEquals(42.0, MVEL.executeExpression(MVEL.compileExpression("array[1][1] = 42.0;\narray[1][1]", pctx), vars));
  }
}
View Full Code Here

Examples of org.mvel2.ParserContext.addIndexedInput()

  public void testIndexedVariableFactory() {
    ParserContext ctx = ParserContext.create();
    String[] vars = {"a", "b"};
    Object[] vals = {"foo", "bar"};
    ctx.setIndexAllocation(true);
    ctx.addIndexedInput(vars);

    String expr = "def myfunc(z) { a + b + z }; myfunc('poop');";

    SharedVariableSpaceModel model = VariableSpaceCompiler.compileShared(expr, ctx, vals);
View Full Code Here

Examples of org.mvel2.ParserContext.addIndexedInput()

     * To prevent the function parameters from being counted as
     * external inputs, we must add them explicitly here.
     */
    for (String s : this.parameters) {
      ctx.addVariable(s, Object.class);
      ctx.addIndexedInput(s);
    }

    /**
     * Compile the expression so we can determine the input-output delta.
     */
 
View Full Code Here

Examples of org.mvel2.ParserContext.addIndexedInput()

     * To prevent the function parameters from being counted as
     * external inputs, we must add them explicitly here.
     */
    for (String s : this.parameters) {
      ctx.addVariable(s, Object.class);
      ctx.addIndexedInput(s);
    }

    /**
     * Compile the expression so we can determine the input-output delta.
     */
 
View Full Code Here

Examples of org.mvel2.ParserContext.addIndexedInput()

        if ( INTERCEPTORS != null ) {
            parserContext.setInterceptors(INTERCEPTORS);
        }

        parserContext.addIndexedInput( inputIdentifiers );
               
        String identifier = null;
        String type = null;
        try {
            for ( int i = 0, length = inputIdentifiers.length; i < length; i++ ) {
View Full Code Here

Examples of org.mvel2.ParserContext.addIndexedInput()

        if ( INTERCEPTORS != null ) {
            parserContext.setInterceptors(INTERCEPTORS);
        }

        parserContext.addIndexedInput( inputIdentifiers );
               
        String identifier = null;
        String type = null;
        try {
            for ( int i = 0, length = inputIdentifiers.length; i < length; i++ ) {
View Full Code Here

Examples of org.mvel2.ParserContext.addIndexedInput()

        if ( INTERCEPTORS != null ) {
            parserContext.setInterceptors(INTERCEPTORS);
        }

        parserContext.addIndexedInput( inputIdentifiers );
               
        String identifier = null;
        String type = null;
        try {
            for ( int i = 0, length = inputIdentifiers.length; i < length; i++ ) {
View Full Code Here

Examples of org.mvel2.ParserContext.addIndexedInput()

        if ( interceptors != null ) {
            parserContext.setInterceptors( interceptors );
        }

        parserContext.addIndexedInput( inputIdentifiers );
               
        String identifier = null;
        String type = null;
        try {
            for ( int i = 0, length = inputIdentifiers.length; i < length; i++ ) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.