Package de.odysseus.el.util

Examples of de.odysseus.el.util.SimpleContext


  SimpleContext context;
 
  @Override
  protected void setUp() throws Exception {
    context = new SimpleContext(new SimpleResolver());
   
    TypeConverter converter = TypeConverter.DEFAULT;
   
    // variables var_long_1, indentifier_string
    context.setVariable("var_long_1", new ObjectValueExpression(converter, 1l, long.class));
View Full Code Here


 
  SimpleContext context;
 
  @Override
  protected void setUp() throws Exception {
    context = new SimpleContext();
   
    // functions ns:f0(), ns:f1(int), ns:f2(int)
    context.setFunction("ns", "f0", getClass().getMethod("foo"));
    context.setFunction("ns", "f1", getClass().getMethod("bar", new Class[]{int.class}));
    context.setFunction("ns", "f2", getClass().getMethod("foobar", new Class[]{int.class, int.class}));
View Full Code Here

    return null;
  }
 
  @Override
  protected void setUp() throws Exception {
    context = new SimpleContext(new SimpleResolver(new BeanELResolver()));
    context.getELResolver().setValue(context, null, "base", this);
   
    bindings = new Bindings(null, new ValueExpression[1]);
  }
View Full Code Here

    // create our resolver
    CompositeELResolver resolver = new CompositeELResolver();
    resolver.add(new BeanELResolver());

    // create our context
    ELContext context = new SimpleContext(resolver);

    // let's go...
    ValueExpression e = null;
   
    e = f.createValueExpression(context, "${'foo'.matches('foo|bar')}", boolean.class);
View Full Code Here

    // create our factory which uses our customized builder
    System.setProperty("javax.el.nullProperties", "true");   
    ExpressionFactory f = new ExpressionFactoryImpl(System.getProperties());

    // create our context
    ELContext context = new SimpleContext();

    // create our expression we want to evaluate
    ValueExpression e = f.createValueExpression(context, "${map[null]}", String.class);

    // create a map containing a value for key <code>null</code> and make it available
    Map<String, String> map = new HashMap<String, String>();
    map.put(null, "foo");
    context.getELResolver().setValue(context, null, "map", map);

    // let's go...
    System.out.println(e.getValue(context)); // --> "foo"
  }
View Full Code Here

    return null;
  }

  @Override
  protected void setUp() throws Exception {
    context = new SimpleContext(new SimpleResolver());
    context.getELResolver().setValue(context, null, "base", this);
   
    HashMap<Object,String> nullmap = new HashMap<Object,String>();
    nullmap.put(null, "foo");
    context.getELResolver().setValue(context, null, "nullmap", nullmap);
View Full Code Here

    return null;
  }
 
  @Override
  protected void setUp() throws Exception {
    context = new SimpleContext(new SimpleResolver(new BeanELResolver()));
    context.getELResolver().setValue(context, null, "base", this);
   
    bindings = new Bindings(null, new ValueExpression[1]);
  }
View Full Code Here

  private final ExpressionFactory _factory;
  private final SimpleContext _context;

  public ELExpressionParser() {
    _factory = new ExpressionFactoryImpl();
    _context = new SimpleContext();
  }
View Full Code Here

TOP

Related Classes of de.odysseus.el.util.SimpleContext

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.