Search in sources :

Example 6 with VariableResolver

use of org.mvel2.integration.VariableResolver 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 7 with VariableResolver

use of org.mvel2.integration.VariableResolver 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)

Example 8 with VariableResolver

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

the class PreFixIncNode method getReducedValueAccelerated.

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

Example 9 with VariableResolver

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

the class IndexedPostFixDecNode method getReducedValueAccelerated.

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

Example 10 with VariableResolver

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

the class FunctionVariableResolverFactory method createVariable.

public VariableResolver createVariable(String name, Object value) {
    VariableResolver resolver = getVariableResolver(name);
    if (resolver == null) {
        int idx = increaseRegisterTableSize();
        this.indexedVariableNames[idx] = name;
        this.indexedVariableResolvers[idx] = new SimpleValueResolver(value);
        variableResolvers.put(name, null);
        // variableResolvers.put(name, this.indexedVariableResolvers[idx] = new SimpleValueResolver(value));
        return this.indexedVariableResolvers[idx];
    } else {
        resolver.setValue(value);
        return resolver;
    }
}
Also used : VariableResolver(org.mvel2.integration.VariableResolver)

Aggregations

VariableResolver (org.mvel2.integration.VariableResolver)18 HashMap (java.util.HashMap)1 AgendaItem (org.drools.core.common.AgendaItem)1 Declaration (org.drools.core.rule.Declaration)1 UnresolveablePropertyException (org.mvel2.UnresolveablePropertyException)1 VariableResolverFactory (org.mvel2.integration.VariableResolverFactory)1 DefaultLocalVariableResolverFactory (org.mvel2.integration.impl.DefaultLocalVariableResolverFactory)1 FunctionVariableResolverFactory (org.mvel2.integration.impl.FunctionVariableResolverFactory)1