/** * Get a constructor declared on this class. * * @param paramTypes the constructor argument types * @return the constructor, or {@code null} of no such constructor exists */ public Constructor<T> getConstructor(Class<?>... paramTypes) { return constructors.get(createParamList(paramTypes)); }
/** * Get a constructor declared on this class. * * @param paramTypes the constructor argument types * @return the constructor, or {@code null} of no such constructor exists */ public Constructor<T> getConstructor(Class<?>... paramTypes) { return constructors.get(createParamList(paramTypes)); }
/** * Get a constructor declared on this class. * * @param paramTypes the constructor argument types * @return the constructor, or {@code null} of no such constructor exists */ public Constructor<?> getConstructor(Class<?>... paramTypes) { return constructors.get(createParamList(paramTypes)); }
/** * Get a constructor declared on this class. * * @param paramTypes the constructor argument types * @return the constructor, or {@code null} of no such constructor exists */ public Constructor<?> getConstructor(Class<?>... paramTypes) { return constructors.get(createParamList(paramTypes)); }
/** * Get a method declared on this object. * * @param returnType the method return type * @param name the name of the method * @param paramTypes the parameter types of the method * @return the method, or {@code null} if no method of that description exists */ public Method getMethod(Class<?> returnType, String name, Class<?>... paramTypes) { final Map<ParamList, Map<Class<?>, Method>> nameMap = methods.get(name); if (nameMap == null) { return null; } final Map<Class<?>, Method> paramsMap = nameMap.get(createParamList(paramTypes)); if (paramsMap == null) { return null; } return paramsMap.get(returnType); }
/** * Get a collection of methods declared on this object. * * @param name the name of the method * @param paramTypes the parameter types of the method * @return the (possibly empty) collection of methods matching the description */ public Collection<Method> getMethods(String name, Class<?>... paramTypes) { final Map<ParamList, Map<Class<?>, Method>> nameMap = methods.get(name); if (nameMap == null) { return Collections.emptySet(); } final Map<Class<?>, Method> paramsMap = nameMap.get(createParamList(paramTypes)); if (paramsMap == null) { return Collections.emptySet(); } return Collections.unmodifiableCollection(paramsMap.values()); }
/** * Get a method declared on this object. * * @param returnType the method return type * @param name the name of the method * @param paramTypes the parameter types of the method * @return the method, or {@code null} if no method of that description exists */ public Method getMethod(Class<?> returnType, String name, Class<?>... paramTypes) { final Map<ParamList, Map<Class<?>, Method>> nameMap = methods.get(name); if (nameMap == null) { return null; } final Map<Class<?>, Method> paramsMap = nameMap.get(createParamList(paramTypes)); if (paramsMap == null) { return null; } return paramsMap.get(returnType); }
/** * Get a method declared on this object. * * @param returnType the method return type * @param name the name of the method * @param paramTypes the parameter types of the method * @return the method, or {@code null} if no method of that description exists */ public Method getMethod(Class<?> returnType, String name, Class<?>... paramTypes) { final Map<ParamList, Map<Class<?>, Method>> nameMap = methods.get(name); if (nameMap == null) { return null; } final Map<Class<?>, Method> paramsMap = nameMap.get(createParamList(paramTypes)); if (paramsMap == null) { return null; } return paramsMap.get(returnType); }
/** * Get a method declared on this object. * * @param returnType the method return type * @param name the name of the method * @param paramTypes the parameter types of the method * @return the method, or {@code null} if no method of that description exists */ public Method getMethod(Class<?> returnType, String name, Class<?>... paramTypes) { final Map<ParamList, Map<Class<?>, Method>> nameMap = methods.get(name); if (nameMap == null) { return null; } final Map<Class<?>, Method> paramsMap = nameMap.get(createParamList(paramTypes)); if (paramsMap == null) { return null; } return paramsMap.get(returnType); }
private static void addMethod(Map<String, Map<ParamList, Map<Class<?>, Method>>> methods, Method method) { final String name = method.getName(); Map<ParamList, Map<Class<?>, Method>> nameMap = methods.get(name); if (nameMap == null) { methods.put(name, nameMap = new HashMap<ParamList, Map<Class<?>, Method>>()); } final Class<?>[] types = method.getParameterTypes(); final ParamList list = createParamList(types); Map<Class<?>, Method> paramsMap = nameMap.get(list); if (paramsMap == null) { nameMap.put(list, paramsMap = new HashMap<Class<?>, Method>()); } //don't allow superclass / interface methods to overwrite existing methods if (!paramsMap.containsKey(method.getReturnType())) { paramsMap.put(method.getReturnType(), method); } }
private static void addMethod(Map<String, Map<ParamList, Map<Class<?>, Method>>> methods, Method method) { final String name = method.getName(); Map<ParamList, Map<Class<?>, Method>> nameMap = methods.get(name); if (nameMap == null) { methods.put(name, nameMap = new HashMap<ParamList, Map<Class<?>, Method>>()); } final Class<?>[] types = method.getParameterTypes(); final ParamList list = createParamList(types); Map<Class<?>, Method> paramsMap = nameMap.get(list); if (paramsMap == null) { nameMap.put(list, paramsMap = new HashMap<Class<?>, Method>()); } //don't allow superclass / interface methods to overwrite existing methods if (!paramsMap.containsKey(method.getReturnType())) { paramsMap.put(method.getReturnType(), method); } }
/** * Get a collection of methods declared on this object. * * @param name the name of the method * @param paramTypes the parameter types of the method * @return the (possibly empty) collection of methods matching the description */ public Collection<Method> getMethods(String name, Class<?>... paramTypes) { final Map<ParamList, Map<Class<?>, Method>> nameMap = methods.get(name); if (nameMap == null) { return Collections.emptySet(); } final Map<Class<?>, Method> paramsMap = nameMap.get(createParamList(paramTypes)); if (paramsMap == null) { return Collections.emptySet(); } return Collections.unmodifiableCollection(paramsMap.values()); }
/** * Get a collection of methods declared on this object. * * @param name the name of the method * @param paramTypes the parameter types of the method * @return the (possibly empty) collection of methods matching the description */ public Collection<Method> getMethods(String name, Class<?>... paramTypes) { final Map<ParamList, Map<Class<?>, Method>> nameMap = methods.get(name); if (nameMap == null) { return Collections.emptySet(); } final Map<Class<?>, Method> paramsMap = nameMap.get(createParamList(paramTypes)); if (paramsMap == null) { return Collections.emptySet(); } return Collections.unmodifiableCollection(paramsMap.values()); }
/** * Get a collection of methods declared on this object. * * @param name the name of the method * @param paramTypes the parameter types of the method * @return the (possibly empty) collection of methods matching the description */ public Collection<Method> getMethods(String name, Class<?>... paramTypes) { final Map<ParamList, Map<Class<?>, Method>> nameMap = methods.get(name); if (nameMap == null) { return Collections.emptySet(); } final Map<Class<?>, Method> paramsMap = nameMap.get(createParamList(paramTypes)); if (paramsMap == null) { return Collections.emptySet(); } return Collections.unmodifiableCollection(paramsMap.values()); }
private static void addMethod(Map<String, Map<ParamList, Map<Class<?>, Method>>> methods, Method method) { final String name = method.getName(); Map<ParamList, Map<Class<?>, Method>> nameMap = methods.get(name); if (nameMap == null) { methods.put(name, nameMap = new HashMap<ParamList, Map<Class<?>, Method>>()); } final Class<?>[] types = method.getParameterTypes(); final ParamList list = createParamList(types); Map<Class<?>, Method> paramsMap = nameMap.get(list); if (paramsMap == null) { nameMap.put(list, paramsMap = new HashMap<Class<?>, Method>()); } //don't allow superclass / interface methods to overwrite existing methods if (!paramsMap.containsKey(method.getReturnType())) { paramsMap.put(method.getReturnType(), method); } }
private static void addMethod(Map<String, Map<ParamList, Map<Class<?>, Method>>> methods, Method method) { final String name = method.getName(); Map<ParamList, Map<Class<?>, Method>> nameMap = methods.get(name); if (nameMap == null) { methods.put(name, nameMap = new HashMap<ParamList, Map<Class<?>, Method>>()); } final Class<?>[] types = method.getParameterTypes(); final ParamList list = createParamList(types); Map<Class<?>, Method> paramsMap = nameMap.get(list); if (paramsMap == null) { nameMap.put(list, paramsMap = new HashMap<Class<?>, Method>()); } //don't allow superclass / interface methods to overwrite existing methods if (!paramsMap.containsKey(method.getReturnType())) { paramsMap.put(method.getReturnType(), method); } }
constructor.setAccessible(true); Class<?>[] parameterTypes = constructor.getParameterTypes(); constructors.put(createParamList(parameterTypes), constructor); constructorsByTypeName.put(createParamNameList(parameterTypes), constructor);
constructor.setAccessible(true); Class<?>[] parameterTypes = constructor.getParameterTypes(); constructors.put(createParamList(parameterTypes), constructor); constructorsByTypeName.put(createParamNameList(parameterTypes), constructor);
constructor.setAccessible(true); Class<?>[] parameterTypes = constructor.getParameterTypes(); constructors.put(createParamList(parameterTypes), constructor); constructorsByTypeName.put(createParamNameList(parameterTypes), constructor);
constructor.setAccessible(true); Class<?>[] parameterTypes = constructor.getParameterTypes(); constructors.put(createParamList(parameterTypes), constructor); constructorsByTypeName.put(createParamNameList(parameterTypes), constructor);