Search in sources :

Example 16 with VariableResolverFactory

use of org.mvel2.integration.VariableResolverFactory in project mvel by mikebrock.

the class IndexedPreFixDecNode method getReducedValueAccelerated.

public Object getReducedValueAccelerated(Object ctx, Object thisValue, VariableResolverFactory factory) {
    VariableResolver vResolver = factory.getIndexedVariableResolver(register);
    vResolver.setValue(ctx = MathProcessor.doOperations(vResolver.getValue(), Operator.SUB, DataTypes.INTEGER, 1));
    return ctx;
}
Also used : VariableResolver(org.mvel2.integration.VariableResolver)

Example 17 with VariableResolverFactory

use of org.mvel2.integration.VariableResolverFactory in project mvel by mikebrock.

the class LiteralDeepPropertyNode method getReducedValueAccelerated.

public Object getReducedValueAccelerated(Object ctx, Object thisValue, VariableResolverFactory factory) {
    if (accessor != null) {
        return accessor.getValue(literal, thisValue, factory);
    } else {
        try {
            AccessorOptimizer aO = getThreadAccessorOptimizer();
            accessor = aO.optimizeAccessor(getCurrentThreadParserContext(), expr, start, offset, literal, thisValue, factory, false, null);
            return aO.getResultOptPass();
        } finally {
            OptimizerFactory.clearThreadAccessorOptimizer();
        }
    }
}
Also used : AccessorOptimizer(org.mvel2.optimizers.AccessorOptimizer) OptimizerFactory.getThreadAccessorOptimizer(org.mvel2.optimizers.OptimizerFactory.getThreadAccessorOptimizer)

Example 18 with VariableResolverFactory

use of org.mvel2.integration.VariableResolverFactory in project mvel by mikebrock.

the class PostFixDecNode method getReducedValueAccelerated.

public Object getReducedValueAccelerated(Object ctx, Object thisValue, VariableResolverFactory factory) {
    VariableResolver vResolver = factory.getVariableResolver(name);
    vResolver.setValue(MathProcessor.doOperations(ctx = vResolver.getValue(), Operator.SUB, DataTypes.INTEGER, 1));
    return ctx;
}
Also used : VariableResolver(org.mvel2.integration.VariableResolver)

Example 19 with VariableResolverFactory

use of org.mvel2.integration.VariableResolverFactory in project mvel by mikebrock.

the class PostFixIncNode method getReducedValueAccelerated.

public Object getReducedValueAccelerated(Object ctx, Object thisValue, VariableResolverFactory factory) {
    VariableResolver vResolver = factory.getVariableResolver(name);
    vResolver.setValue(MathProcessor.doOperations(ctx = vResolver.getValue(), Operator.ADD, DataTypes.INTEGER, 1));
    return ctx;
}
Also used : VariableResolver(org.mvel2.integration.VariableResolver)

Example 20 with VariableResolverFactory

use of org.mvel2.integration.VariableResolverFactory in project mvel by mikebrock.

the class PreFixDecNode method getReducedValueAccelerated.

public Object getReducedValueAccelerated(Object ctx, Object thisValue, VariableResolverFactory factory) {
    VariableResolver vResolver = factory.getVariableResolver(name);
    vResolver.setValue(ctx = MathProcessor.doOperations(vResolver.getValue(), Operator.SUB, DataTypes.INTEGER, 1));
    return ctx;
}
Also used : VariableResolver(org.mvel2.integration.VariableResolver)

Aggregations

VariableResolverFactory (org.mvel2.integration.VariableResolverFactory)16 DefaultLocalVariableResolverFactory (org.mvel2.integration.impl.DefaultLocalVariableResolverFactory)15 MapVariableResolverFactory (org.mvel2.integration.impl.MapVariableResolverFactory)15 VariableResolver (org.mvel2.integration.VariableResolver)14 HashMap (java.util.HashMap)10 CompileException (org.mvel2.CompileException)7 ParserContext (org.mvel2.ParserContext)7 AccessorOptimizer (org.mvel2.optimizers.AccessorOptimizer)7 List (java.util.List)6 Map (java.util.Map)6 ExpressionCompiler (org.mvel2.compiler.ExpressionCompiler)6 Serializable (java.io.Serializable)5 ArrayList (java.util.ArrayList)5 ASTNode (org.mvel2.ast.ASTNode)5 CompiledExpression (org.mvel2.compiler.CompiledExpression)5 Foo (org.mvel2.tests.core.res.Foo)5 IOException (java.io.IOException)4 Debugger (org.mvel2.debug.Debugger)4 Frame (org.mvel2.debug.Frame)4 Interceptor (org.mvel2.integration.Interceptor)4