Package org.apache.commons.jexl2

Examples of org.apache.commons.jexl2.JexlEngine$Frame


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

    public JexlContext addAttrsToContext(final Collection<? extends AbstractAttr> attributes,
            final JexlContext jexlContext) {

        JexlContext context = jexlContext == null
                ? new MapContext()
                : jexlContext;

        for (AbstractAttr attr : attributes) {
            List<String> attributeValues = attr.getValuesAsStrings();
            String expressionValue = attributeValues.isEmpty()
View Full Code Here

    public JexlContext addDerAttrsToContext(final Collection<? extends AbstractDerAttr> derAttrs,
            final Collection<? extends AbstractAttr> attrs, final JexlContext jexlContext) {

        JexlContext context = jexlContext == null
                ? new MapContext()
                : jexlContext;

        for (AbstractDerAttr derAttr : derAttrs) {
            String expressionValue = derAttr.getValue(attrs);
            if (expressionValue == null) {
View Full Code Here

    public JexlContext addVirAttrsToContext(final Collection<? extends AbstractVirAttr> virAttrs,
            final JexlContext jexlContext) {

        JexlContext context = jexlContext == null
                ? new MapContext()
                : jexlContext;

        for (AbstractVirAttr virAttr : virAttrs) {
            List<String> attributeValues = virAttr.getValues();
            String expressionValue = attributeValues.isEmpty()
View Full Code Here

TOP

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

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.