Examples of SimpleContext


Examples of de.odysseus.el.util.SimpleContext

    CompositeELResolver resolver = new CompositeELResolver();
    resolver.add(new PublicMethodResolver());
    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

Examples of de.odysseus.el.util.SimpleContext

    // 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

Examples of de.odysseus.el.util.SimpleContext

  SimpleContext context;
 
  @Override
  protected void setUp() throws Exception {
    context = new SimpleContext(new SimpleResolver());
   
    // variables var_long_1, indentifier_string
    context.setVariable("var_long_1", new ObjectValueExpression(1l, long.class));
    context.setVariable("indentifier_string", new ObjectValueExpression("foo", String.class));
    context.setVariable("var_method_1", new ObjectValueExpression(getClass().getMethod("method_1"), Method.class));
View Full Code Here

Examples of de.odysseus.el.util.SimpleContext

 
  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

Examples of de.odysseus.el.util.SimpleContext

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

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

Examples of de.odysseus.el.util.SimpleContext

 
  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

Examples of de.odysseus.el.util.SimpleContext

{
    private SimpleContext simpleContext;

    public DefaultELContext(ELResolver elResolver)
    {
        this.simpleContext = new SimpleContext(elResolver);
    }
View Full Code Here

Examples of de.odysseus.el.util.SimpleContext

{
    private SimpleContext simpleContext;

    public TestELContext(ELResolver elResolver)
    {
        this.simpleContext = new SimpleContext(elResolver);
    }
View Full Code Here

Examples of de.odysseus.el.util.SimpleContext

        return context;
    }

    protected void setVariable(ELContext context, String name, Object value, Class<?> type) {
        ValueExpression valueExpression = getExpressionFactory().createValueExpression(value, type);
        SimpleContext simpleContext = (SimpleContext) context;
        simpleContext.setVariable(name, valueExpression);
    }
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.