Package org.mvel2.integration

Examples of org.mvel2.integration.VariableResolverFactory


    return null;
  }

  public Object getReducedValue(Object ctx, Object thisValue, VariableResolverFactory factory) {
    VariableResolverFactory ctxFactory = new MapVariableResolverFactory(new HashMap<String, Object>(), factory);

    while ((Boolean) condition.getValue(ctx, thisValue, factory)) {
      compiledBlock.getValue(ctx, thisValue, ctxFactory);
    }
    return null;
View Full Code Here


      pCtx.popVariableScope();
    }
  }

  public Object getReducedValueAccelerated(Object ctx, Object thisValue, VariableResolverFactory factory) {
    VariableResolverFactory lc = new MapVariableResolverFactory(new HashMap(0), factory);

    do {
      compiledBlock.getValue(ctx, thisValue, lc);
    }
    while (!(Boolean) condition.getValue(ctx, thisValue, lc));
View Full Code Here

    return null;
  }

  public Object getReducedValue(Object ctx, Object thisValue, VariableResolverFactory factory) {
    VariableResolverFactory lc = new MapVariableResolverFactory(new HashMap(0), factory);

    do {
      compiledBlock.getValue(ctx, thisValue, lc);
    }
    while (!(Boolean) condition.getValue(ctx, thisValue, lc));
View Full Code Here

  public void appendFactory(VariableResolverFactory resolverFactory) {
    if (nextFactory == null) {
      nextFactory = resolverFactory;
    }
    else {
      VariableResolverFactory vrf = nextFactory;
      while (vrf.getNextFactory() != null) {
        vrf = vrf.getNextFactory();
      }
      vrf.setNextFactory(nextFactory);
    }
  }
View Full Code Here

        parameterTypes = m.getParameterTypes();
      }
    }

    if (ctx instanceof PrototypalFunctionInstance) {
      final VariableResolverFactory funcCtx = ((PrototypalFunctionInstance) ctx).getResolverFactory();
      Object prop = funcCtx.getVariableResolver(name).getValue();
      if (prop instanceof PrototypalFunctionInstance) {
        return ((PrototypalFunctionInstance) prop).call(ctx, thisReference, new InvokationContextFactory(variableFactory, funcCtx), args);
      }
    }
View Full Code Here

  public StackDelimiterResolverFactory(VariableResolverFactory delegate) {
    super(delegate);
  }

  public VariableResolver createVariable(String name, Object value) {
    VariableResolverFactory delegate = getDelegate();
    VariableResolverFactory nextFactory = delegate.getNextFactory();
    delegate.setNextFactory(null);
    VariableResolver resolver = delegate.createVariable(name, value);
    delegate.setNextFactory(nextFactory);
    return resolver;
  }
View Full Code Here

      pCtx.popVariableScope();
    }
  }

  public Object getReducedValueAccelerated(Object ctx, Object thisValue, VariableResolverFactory factory) {
    VariableResolverFactory ctxFactory = new MapVariableResolverFactory(new HashMap<String, Object>(0), factory);

    do {
      compiledBlock.getValue(ctx, thisValue, ctxFactory);
    }
    while ((Boolean) condition.getValue(ctx, thisValue, factory));
View Full Code Here

    return null;
  }

  public Object getReducedValue(Object ctx, Object thisValue, VariableResolverFactory factory) {
    VariableResolverFactory ctxFactory = new MapVariableResolverFactory(new HashMap<String, Object>(0), factory);

    do {
      compiledBlock.getValue(ctx, thisValue, ctxFactory);
    }
    while ((Boolean) condition.getValue(ctx, thisValue, factory));
View Full Code Here

  public static Map<String, VariableResolver> getAllVariableResolvers(VariableResolverFactory rootFactory) {

    Map<String, VariableResolver> allVariableResolvers = new HashMap<String, VariableResolver>();

    VariableResolverFactory vrf = rootFactory;
    do {
      for (String var : vrf.getKnownVariables()) {
        allVariableResolvers.put(var, vrf.getVariableResolver(var));
      }
    }
    while ((vrf = vrf.getNextFactory()) != null);

    return allVariableResolvers;
  }
View Full Code Here

  public void testThisReferenceMapVirtualObjects() {
    Map<String, String> map = new HashMap<String, String>();
    map.put("foo",
        "bar");

    VariableResolverFactory factory = new MapVariableResolverFactory(new HashMap<String, Object>());
    factory.createVariable("this", map);

    assertEquals(true,
        eval("this.foo == 'bar'", map, factory));
  }
View Full Code Here

TOP

Related Classes of org.mvel2.integration.VariableResolverFactory

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.