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

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


    /** the list of keys we generated & test against */
    private static final MethodKey[] keyList;
   
    /** Creates & inserts a key into the byKey & byString map */
    private static void setUpKey(String name, Class<?>[] parms) {
        MethodKey key = new MethodKey(name, parms);
        String str = key.toString();
        byKey.put(key, str);
        byString.put(str, key);
       
    }
View Full Code Here


    }
   
    /** Checks that a string key does exist */
    void checkStringKey(String method, Class<?>... params) {
        String key = makeStringKey(method, params);
        MethodKey out = byString.get(key);
        assertTrue(out != null);
    }
View Full Code Here

        assertTrue(out != null);
    }
       
    /** Builds a method key */
    MethodKey makeKey(String method, Class<?>... params) {
        return new MethodKey(method, params);
    }
View Full Code Here

        return new MethodKey(method, params);
    }
   
    /** Checks that a method key exists */
    void checkKey(String method, Class<?>... params) {
        MethodKey key = makeKey(method, params);
        String out = byKey.get(key);
        assertTrue(out != null);
    }
View Full Code Here

        assertTrue(out != null);
    }
   
    public void testObjectKey() throws Exception {
        for(int k = 0; k < keyList.length; ++k) {
            MethodKey ctl = keyList[k];
            MethodKey key = makeKey(ctl.getMethod(), ctl.getParameters());
            String out = byKey.get(key);
            assertTrue(out != null);
            assertTrue(ctl.toString() + " != " + out, ctl.toString().equals(out));
        }
       
View Full Code Here

       
    }
   
    public void testStringKey() throws Exception {
        for(int k = 0; k < keyList.length; ++k) {
            MethodKey ctl = keyList[k];
            String key = makeStringKey(ctl.getMethod(), ctl.getParameters());
            MethodKey out = byString.get(key);
            assertTrue(out != null);
            assertTrue(ctl.toString() + " != " + key, ctl.equals(out));
        }
       
    }
View Full Code Here

    private static final int LOOP = 3;//00;
   
    public void testPerfKey() throws Exception {
        for(int l = 0; l < LOOP; ++l)
        for(int k = 0; k < keyList.length; ++k) {
            MethodKey ctl = keyList[k];
            MethodKey key = makeKey(ctl.getMethod(), ctl.getParameters());
            String out = byKey.get(key);
            assertTrue(out != null);
        }
    }
View Full Code Here

    }
   
    public void testPerfString() throws Exception {
        for(int l = 0; l < LOOP; ++l)
        for(int k = 0; k < keyList.length; ++k) {
            MethodKey ctl = keyList[k];
            String key = makeStringKey(ctl.getMethod(), ctl.getParameters());
            MethodKey out = byString.get(key);
            assertTrue(out != null);
        }
    }
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

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.