Package org.apache.commons.jexl2

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


        }
        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

   * Creates a new JEXL engine instance.
   *
   * @return a new {@link JexlEngine}
   */
  public static JexlEngine createJexlEngine() {
    return new JexlEngine();
  }
View Full Code Here

    private static JexlEngine jexlEngine;

    private static JexlEngine getEngine() {
        synchronized (LOG) {
            if (jexlEngine == null) {
                jexlEngine = new JexlEngine(new ClassFreeUberspectImpl(null), null, null, null);
                jexlEngine.setClassLoader(new EmptyClassLoader());
                jexlEngine.setCache(512);
                jexlEngine.setLenient(true);
                jexlEngine.setSilent(false);
            }
View Full Code Here

import java.util.Map;

public class ELUtil {
    public static Object invoke(String expression, Map<String, Object> context) {
        JexlEngine jexl = new JexlEngine();
        Expression el = jexl.createExpression(expression);
        JexlContext elContext = new MapContext();
        for (String property : context.keySet()) {
            elContext.set(property, context.get(property));
        }
        return el.evaluate(elContext);
View Full Code Here

   
    public JexlExpressionParser(final Map<String, Object> vars) {
        if (vars == null) {
            throw new IllegalArgumentException("vars: " + vars);
        }
        engine = new JexlEngine();
        context = new MapContext(vars);

        LOGGER.trace("Using variables: {}", vars);
    }
View Full Code Here

  /**
   * Create a new naming strategy using an JEXL expression and the default expression.
   */
  public JexlNamingStrategy() throws JexlException {
    jexl = new JexlEngine();
    this.parsedExpr = jexl.createExpression(DEFAULT_EXPRESSION);
  }
View Full Code Here

   * Create a new naming strategy using an JEXL expression and the given expression.
   *
   * @param expr - the JEXL expression to use to create names.
   */
  public JexlNamingStrategy(String expr) throws JexlException {
    jexl = new JexlEngine();
    this.parsedExpr = jexl.createExpression(expr);
  }
View Full Code Here

        return null;
    }
   
    /** {@inheritDoc} */
    public String debugString() {
        JexlInfo info = getInfo();
        return info != null? info.debugString() : "";
    }
View Full Code Here

        return result;
    }

    public JexlContext addFieldsToContext(final Object attributable, final JexlContext jexlContext) {
        JexlContext context = jexlContext == null
                ? new MapContext()
                : jexlContext;

        final Field[] fields = attributable.getClass().getDeclaredFields();
        for (int i = 0; i < fields.length; i++) {
            try {
View Full Code Here

TOP

Related Classes of org.apache.commons.jexl2.JexlEngine

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.