Examples of JexlEngine


Examples of org.apache.commons.jexl2.JexlEngine

            // it worked!
        }
    }

    public void testVariable() throws Exception {
        JexlEngine jexl = new JexlEngine();
        jexl.setSilent(true);
        Asserter asserter = new Asserter(jexl);
        asserter.setVariable("foo", new Foo());
        asserter.setVariable("person", "James");

        asserter.assertExpression("person", "James");
View Full Code Here

Examples of org.apache.commons.jexl2.JexlEngine

  private JexlEngine engine;
  private Expression expression;
  private boolean isStrict;

  public PartitionExpression(String expression, boolean isStrict) {
    this.engine = new JexlEngine();
    Map<String, Object> fns = new HashMap<String, Object>();
    fns.put(null, PartitionFunctions.class);
    this.engine.setFunctions(fns);
    this.engine.setStrict(true);
    this.engine.setSilent(false);
View Full Code Here

Examples of org.apache.commons.jexl2.JexlEngine

  private JexlEngine engine;
  private Expression expression;
  private boolean isStrict;

  public PartitionExpression(String expression, boolean isStrict) {
    this.engine = new JexlEngine();
    Map<String, Object> fns = new HashMap<String, Object>();
    fns.put(null, PartitionFunctions.class);
    this.engine.setFunctions(fns);
    this.engine.setStrict(true);
    this.engine.setSilent(false);
View Full Code Here

Examples of org.apache.commons.jexl2.JexlEngine

    /**
     * Get JexlEngine from ThreadLocal
     * @return JexlEngine
     */
    private static JexlEngine getJexlEngine() {
        JexlEngine engine = threadLocalJexl.get();
        if(engine == null) {
            engine = new JexlEngine();
            engine.setCache(512);
            engine.setLenient(false);
            engine.setSilent(false);
            threadLocalJexl.set(engine);
        }
        return engine;
    }
View Full Code Here

Examples of org.apache.commons.jexl2.JexlEngine

    public void threadStarted() {
    }

    @Override
    public void threadFinished() {
        JexlEngine engine = threadLocalJexl.get();
        if(engine != null) {
            engine.clearCache();
            threadLocalJexl.remove();
        }
    }
View Full Code Here

Examples of org.apache.commons.jexl2.JexlEngine

     * initialization code before expression creation &amp; evaluation.</p>
     * @param silent true means no JexlException will occur, false allows them
     */
    public void setJexlEngineSilent(boolean silent) {
        synchronized (this) {
            JexlEngine engine = getJexlEngine();
            engine.setSilent(silent);
            this.jexlEngineSilent = silent;
        }
    }
View Full Code Here

Examples of org.apache.commons.jexl2.JexlEngine

     * initialization code before expression creation &amp; evaluation.</p>
     * @param strict true for strict, false for lenient
     */
    public void setJexlEngineStrict(boolean strict) {
        synchronized (this) {
            JexlEngine engine = getJexlEngine();
            engine.setStrict(strict);
            this.jexlEngineStrict = strict;
        }
    }
View Full Code Here

Examples of org.apache.commons.jexl2.JexlEngine

     * This method can be overriden to specify more detailed options
     * into the JexlEngine.
     * @return
     */
    protected JexlEngine createJexlEngine() {
        JexlEngine engine = new JexlEngine();
        // With null prefix, define top-level user defined functions.
        // See javadoc of org.apache.commons.jexl2.JexlEngine#setFunctions(Map<String,Object> funcs) for detail.
        Map<String, Object> funcs = new HashMap<String, Object>();
        funcs.put(null, JexlBuiltin.class);
        engine.setFunctions(funcs);
        engine.setCache(256);
        return engine;
    }
View Full Code Here

Examples of org.apache.commons.jexl2.JexlEngine

     * <EM>NOTE: The internal JexlEngine instance can be null when this is deserialized.</EM>
     * </P>
     * @return
     */
    private JexlEngine getJexlEngine() {
        JexlEngine engine = jexlEngine;
        if (engine == null) {
            synchronized (this) {
                engine = jexlEngine;
                if (engine == null) {
                    jexlEngine = engine = createJexlEngine();
View Full Code Here

Examples of org.apache.commons.jexl2.JexlEngine

        }
        return super.getMethod(obj, method, args, info);
      }
    };

    JexlEngine engine = new JexlEngine(uberspect, null, null, null);
    engine.setStrict(true);
    engine.setClassLoader(cl);
    return engine;
  }
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.