Package org.apache.commons.jexl2.internal.introspection

Examples of org.apache.commons.jexl2.internal.introspection.MethodKey$AmbiguousException


        for (Entry<Object,Object> entry : System.getProperties().entrySet()){
            sysVars.put((String)entry.getKey(), entry.getValue());
        }
       
        engine = new JexlEngine();
        context = new MapContext(sysVars);
        variables = sysVars;
       
        log.trace("Using variables: {}", sysVars);
    }
View Full Code Here


        log.debug("Evaluating expression: {}", expression);
       
        Expression expr = engine.createExpression(expression);

        JexlContext ctx = new MapContext(vars);

        Object result = expr.evaluate(ctx);
        log.debug("Result: {}", result);

        return result;
View Full Code Here

        }

        // Evaluate AccountLink expression
        String evalAccountLink = null;
        if (StringUtils.isNotBlank(attrUtil.getAccountLink(resource))) {
            final JexlContext jexlContext = new MapContext();
            JexlUtil.addFieldsToContext(subject, jexlContext);
            JexlUtil.addAttrsToContext(subject.getAttributes(), jexlContext);
            JexlUtil.addDerAttrsToContext(subject.getDerivedAttributes(), subject.getAttributes(), jexlContext);
            evalAccountLink = JexlUtil.evaluate(attrUtil.getAccountLink(resource), jexlContext);
        }
View Full Code Here

    /**
     * {@inheritDoc }
     */
    public Object evaluate(Object context, String expression) {
        Expression jexlExpression = engine.createExpression(expression);
        JexlContext jexlContext = new ObjectContext(engine, context);
       
        return jexlExpression.evaluate(jexlContext);
    }
View Full Code Here

    }

    /** {@inheritDoc} */
    @Override
    public Object tryExecute(String name, Object obj, Object[] args) {
        MethodKey tkey = new MethodKey(name, args);
        // let's assume that invocation will fly if the declaring class is the
        // same and arguments have the same type
        if (objectClass.equals(obj.getClass()) && tkey.equals(key)) {
            try {
                return execute(obj, args);
            } catch (InvocationTargetException xinvoke) {
                return TRY_FAILED; // fail
            } catch (IllegalAccessException xill) {
View Full Code Here

     * @return a filled up parameter (may contain a null method)
     */
    private static Parameter discover(Introspector is,
            Object obj, String method, Object[] args) {
        final Class<?> clazz = obj.getClass();
        final MethodKey key = new MethodKey(method, args);
        java.lang.reflect.Method m = is.getMethod(clazz, key);
        if (m == null && clazz.isArray()) {
            // check for support via our array->list wrapper
            m = is.getMethod(ArrayListWrapper.class, key);
        }
View Full Code Here

    }

    /** {@inheritDoc} */
    @Override
    public Object tryExecute(String name, Object o, Object[] args) {
        MethodKey tkey = new MethodKey(name, args);
        // let's assume that invocation will fly if the declaring class is the
        // same and arguments have the same type
        if (objectClass.equals(o.getClass()) && tkey.equals(key)) {
            try {
                return execute(o, args);
            } catch (InvocationTargetException xinvoke) {
                return TRY_FAILED; // fail
            } catch (IllegalAccessException xill) {
View Full Code Here

     * @return a filled up parameter (may contain a null method)
     */
    private static Parameter discover(Introspector is,
            Object obj, String method, Object[] args) {
        final Class<?> clazz = obj.getClass();
        final MethodKey key = new MethodKey(method, args);
        java.lang.reflect.Method m = is.getMethod(clazz, key);
        if (m == null && clazz.isArray()) {
            // check for support via our array->list wrapper
            m = is.getMethod(ArrayListWrapper.class, key);
        }
View Full Code Here

     * @return The desired Method object.
     * @throws IllegalArgumentException When the parameters passed in can not be used for introspection.
     * CSOFF: RedundantThrows
     */
    protected final Method getMethod(Class<?> c, String name, Object[] params) throws IllegalArgumentException {
        return base().getMethod(c, new MethodKey(name, params));
    }
View Full Code Here

        } else if (ctorHandle != null) {
            className = ctorHandle.toString();
        } else {
            return null;
        }
        return base().getConstructor(clazz, new MethodKey(className, args));
    }
View Full Code Here

TOP

Related Classes of org.apache.commons.jexl2.internal.introspection.MethodKey$AmbiguousException

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.