/** * <p>Return the <code>MetaData</code> for the specified className.</p> * * <p>This will check the cache associated with the specified * <code>ClassLoader</code>. If there is no cache hit, then a new * <code>MetaData</code> instance will be created and stored. * * @param loader <code>ClassLoader</code> * @param className the class of interest * @return a <code>MetaData</code> object for the specified Class */ private static MetaData getMetaData(ClassLoader loader, String className) { ConcurrentMap<String, MetaData> cache = REFLECTION_CACHE.get(loader); if (cache == null) { initCache(loader); cache = REFLECTION_CACHE.get(loader); } MetaData meta = cache.get(className); if (meta == null) { try { Class<?> clazz = Util.loadClass(className, cache); meta = new MetaData(clazz); cache.put(className, meta); } catch (ClassNotFoundException cnfe) { return null; } } return meta; }
constructors = new HashMap<>(ctors.length, 1.0f); for (int i = 0, len = ctors.length; i < len; i++) { constructors.put(getKey(ctors[i].getParameterTypes()), ctors[i]); methods.put(name, methodsMap); methodsMap.put(getKey(meths[i].getParameterTypes()), meths[i]); declaredMethods.put(name, declaredMethodsMap); declaredMethodsMap.put(getKey(meths[i].getParameterTypes()), meths[i]);
constructors = new HashMap<>(ctors.length, 1.0f); for (int i = 0, len = ctors.length; i < len; i++) { constructors.put(getKey(ctors[i].getParameterTypes()), ctors[i]); methods.put(name, methodsMap); methodsMap.put(getKey(meths[i].getParameterTypes()), meths[i]); declaredMethods.put(name, declaredMethodsMap); declaredMethodsMap.put(getKey(meths[i].getParameterTypes()), meths[i]);
constructors = new HashMap<Integer,Constructor>(ctors.length, 1.0f); for (int i = 0, len = ctors.length; i < len; i++) { constructors.put(getKey(ctors[i].getParameterTypes()), ctors[i]); methods.put(name, methodsMap); methodsMap.put(getKey(meths[i].getParameterTypes()), meths[i]); declaredMethods.put(name, declaredMethodsMap); declaredMethodsMap.put(getKey(meths[i].getParameterTypes()), meths[i]);
constructors = new HashMap<>(ctors.length, 1.0f); for (int i = 0, len = ctors.length; i < len; i++) { constructors.put(getKey(ctors[i].getParameterTypes()), ctors[i]); methods.put(name, methodsMap); methodsMap.put(getKey(meths[i].getParameterTypes()), meths[i]); declaredMethods.put(name, declaredMethodsMap); declaredMethodsMap.put(getKey(meths[i].getParameterTypes()), meths[i]);
constructors = new HashMap<Integer,Constructor>(ctors.length, 1.0f); for (int i = 0, len = ctors.length; i < len; i++) { constructors.put(getKey(ctors[i].getParameterTypes()), ctors[i]); methods.put(name, methodsMap); methodsMap.put(getKey(meths[i].getParameterTypes()), meths[i]); declaredMethods.put(name, declaredMethodsMap); declaredMethodsMap.put(getKey(meths[i].getParameterTypes()), meths[i]);
/** * <p>Return the <code>MetaData</code> for the specified className.</p> * * <p>This will check the cache associated with the specified * <code>ClassLoader</code>. If there is no cache hit, then a new * <code>MetaData</code> instance will be created and stored. * * @param loader <code>ClassLoader</code> * @param className the class of interest * @return a <code>MetaData</code> object for the specified Class */ private static MetaData getMetaData(ClassLoader loader, String className) { ConcurrentMap<String, MetaData> cache = REFLECTION_CACHE.get(loader); if (cache == null) { initCache(loader); cache = REFLECTION_CACHE.get(loader); } MetaData meta = cache.get(className); if (meta == null) { try { Class<?> clazz = Util.loadClass(className, cache); meta = new MetaData(clazz); cache.put(className, meta); } catch (ClassNotFoundException cnfe) { return null; } } return meta; }
/** * <p>Return the <code>MetaData</code> for the specified Class.</p> * * <p>This will check the cache associated with the specified * <code>ClassLoader</code>. If there is no cache hit, then a new * <code>MetaData</code> instance will be created and stored. * * @param loader <code>ClassLoader</code> * @param clazz the Class of interest * @return a <code>MetaData</code> object for the specified Class */ private static MetaData getMetaData(ClassLoader loader, Class<?> clazz) { ConcurrentMap<String, MetaData> cache = REFLECTION_CACHE.get(loader); if (cache == null) { initCache(loader); cache = REFLECTION_CACHE.get(loader); } MetaData meta = cache.get(clazz.getName()); if (meta == null) { meta = new MetaData(clazz); cache.put(clazz.getName(), meta); } return meta; }
/** * <p>Return the <code>MetaData</code> for the specified className.</p> * * <p>This will check the cache associated with the specified * <code>ClassLoader</code>. If there is no cache hit, then a new * <code>MetaData</code> instance will be created and stored. * * @param loader <code>ClassLoader</code> * @param className the class of interest * @return a <code>MetaData</code> object for the specified Class */ private static MetaData getMetaData(ClassLoader loader, String className) { ConcurrentMap<String, MetaData> cache = REFLECTION_CACHE.get(loader); if (cache == null) { initCache(loader); cache = REFLECTION_CACHE.get(loader); } MetaData meta = cache.get(className); if (meta == null) { try { Class<?> clazz = Util.loadClass(className, cache); meta = new MetaData(clazz); cache.put(className, meta); } catch (ClassNotFoundException cnfe) { return null; } } return meta; }
/** * <p>Return the <code>MetaData</code> for the specified className.</p> * * <p>This will check the cache associated with the specified * <code>ClassLoader</code>. If there is no cache hit, then a new * <code>MetaData</code> instance will be created and stored. * * @param loader <code>ClassLoader</code> * @param className the class of interest * @return a <code>MetaData</code> object for the specified Class */ private static MetaData getMetaData(ClassLoader loader, String className) { ConcurrentMap<String, MetaData> cache = REFLECTION_CACHE.get(loader); if (cache == null) { initCache(loader); cache = REFLECTION_CACHE.get(loader); } MetaData meta = cache.get(className); if (meta == null) { try { Class<?> clazz = Util.loadClass(className, cache); meta = new MetaData(clazz); cache.put(className, meta); } catch (ClassNotFoundException cnfe) { return null; } } return meta; }
/** * <p>Return the <code>MetaData</code> for the specified className.</p> * * <p>This will check the cache associated with the specified * <code>ClassLoader</code>. If there is no cache hit, then a new * <code>MetaData</code> instance will be created and stored. * * @param loader <code>ClassLoader</code> * @param className the class of interest * @return a <code>MetaData</code> object for the specified Class */ private static MetaData getMetaData(ClassLoader loader, String className) { ConcurrentMap<String, MetaData> cache = REFLECTION_CACHE.get(loader); if (cache == null) { initCache(loader); cache = REFLECTION_CACHE.get(loader); } MetaData meta = cache.get(className); if (meta == null) { try { Class<?> clazz = Util.loadClass(className, cache); meta = new MetaData(clazz); cache.put(className, meta); } catch (ClassNotFoundException cnfe) { return null; } } return meta; }
/** * <p>Return the <code>MetaData</code> for the specified Class.</p> * * <p>This will check the cache associated with the specified * <code>ClassLoader</code>. If there is no cache hit, then a new * <code>MetaData</code> instance will be created and stored. * * @param loader <code>ClassLoader</code> * @param clazz the Class of interest * @return a <code>MetaData</code> object for the specified Class */ private static MetaData getMetaData(ClassLoader loader, Class<?> clazz) { ConcurrentMap<String, MetaData> cache = REFLECTION_CACHE.get(loader); if (cache == null) { initCache(loader); cache = REFLECTION_CACHE.get(loader); } MetaData meta = cache.get(clazz.getName()); if (meta == null) { meta = new MetaData(clazz); cache.put(clazz.getName(), meta); } return meta; }
/** * <p>Return the <code>MetaData</code> for the specified Class.</p> * * <p>This will check the cache associated with the specified * <code>ClassLoader</code>. If there is no cache hit, then a new * <code>MetaData</code> instance will be created and stored. * * @param loader <code>ClassLoader</code> * @param clazz the Class of interest * @return a <code>MetaData</code> object for the specified Class */ private static MetaData getMetaData(ClassLoader loader, Class<?> clazz) { ConcurrentMap<String, MetaData> cache = REFLECTION_CACHE.get(loader); if (cache == null) { initCache(loader); cache = REFLECTION_CACHE.get(loader); } MetaData meta = cache.get(clazz.getName()); if (meta == null) { meta = new MetaData(clazz); cache.put(clazz.getName(), meta); } return meta; }
/** * <p>Return the <code>MetaData</code> for the specified Class.</p> * * <p>This will check the cache associated with the specified * <code>ClassLoader</code>. If there is no cache hit, then a new * <code>MetaData</code> instance will be created and stored. * * @param loader <code>ClassLoader</code> * @param clazz the Class of interest * @return a <code>MetaData</code> object for the specified Class */ private static MetaData getMetaData(ClassLoader loader, Class<?> clazz) { ConcurrentMap<String, MetaData> cache = REFLECTION_CACHE.get(loader); if (cache == null) { initCache(loader); cache = REFLECTION_CACHE.get(loader); } MetaData meta = cache.get(clazz.getName()); if (meta == null) { meta = new MetaData(clazz); cache.put(clazz.getName(), meta); } return meta; }
/** * <p>Return the <code>MetaData</code> for the specified Class.</p> * * <p>This will check the cache associated with the specified * <code>ClassLoader</code>. If there is no cache hit, then a new * <code>MetaData</code> instance will be created and stored. * * @param loader <code>ClassLoader</code> * @param clazz the Class of interest * @return a <code>MetaData</code> object for the specified Class */ private static MetaData getMetaData(ClassLoader loader, Class<?> clazz) { ConcurrentMap<String, MetaData> cache = REFLECTION_CACHE.get(loader); if (cache == null) { initCache(loader); cache = REFLECTION_CACHE.get(loader); } MetaData meta = cache.get(clazz.getName()); if (meta == null) { meta = new MetaData(clazz); cache.put(clazz.getName(), meta); } return meta; }
/** * <p>Looks up a <code>Method</code> based off the specified method * name and <code>params</code>.</p> * @param name the name of the <cod>Method</code> * @param params the <code>Method</code> parameters * @return the <code>Method</code> appropriate to the specified * name and parameters or <code>null</code> */ public Method lookupMethod(String name, Class<?>... params) { Map<Integer,Method> map = methods.get(name); Integer key = getKey(params); Method result = null; if ((null == map) || null == (result = map.get(key))) { map = declaredMethods.get(name); if (null != map) { result = map.get(key); } } return result; }
/** * <p>Looks up a <code>Method</code> based off the specified method * name and <code>params</code>.</p> * @param name the name of the <cod>Method</code> * @param params the <code>Method</code> parameters * @return the <code>Method</code> appropriate to the specified * name and parameters or <code>null</code> */ public Method lookupMethod(String name, Class<?>... params) { Map<Integer,Method> map = methods.get(name); Integer key = getKey(params); Method result = null; if ((null == map) || null == (result = map.get(key))) { map = declaredMethods.get(name); if (null != map) { result = map.get(key); } } return result; }
/** * <p>Looks up a <code>Method</code> based off the specified method * name and <code>params</code>.</p> * @param name the name of the <cod>Method</code> * @param params the <code>Method</code> parameters * @return the <code>Method</code> appropriate to the specified * name and parameters or <code>null</code> */ public Method lookupMethod(String name, Class<?>... params) { Map<Integer,Method> map = methods.get(name); Integer key = getKey(params); Method result = null; if ((null == map) || null == (result = map.get(key))) { map = declaredMethods.get(name); if (null != map) { result = map.get(key); } } return result; }
/** * <p>Looks up a <code>Method</code> based off the specified method * name and <code>params</code>.</p> * @param name the name of the <cod>Method</code> * @param params the <code>Method</code> parameters * @return the <code>Method</code> appropriate to the specified * name and parameters or <code>null</code> */ public Method lookupMethod(String name, Class<?>... params) { Map<Integer,Method> map = methods.get(name); Integer key = getKey(params); Method result = null; if ((null == map) || null == (result = map.get(key))) { map = declaredMethods.get(name); if (null != map) { result = map.get(key); } } return result; }
/** * <p>Looks up a <code>Method</code> based off the specified method * name and <code>params</code>.</p> * @param name the name of the <cod>Method</code> * @param params the <code>Method</code> parameters * @return the <code>Method</code> appropriate to the specified * name and parameters or <code>null</code> */ public Method lookupMethod(String name, Class<?>... params) { Map<Integer,Method> map = methods.get(name); Integer key = getKey(params); Method result = null; if ((null == map) || null == (result = map.get(key))) { map = declaredMethods.get(name); if (null != map) { result = map.get(key); } } return result; }