Package tigase.util.reflection
Class ReflectionHelper
java.lang.Object
tigase.util.reflection.ReflectionHelper
Utility class with useful methods to work with reflections
- Author:
- andrzej
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceReflectionHelper.Handler<A extends Annotation,T> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanboundMatch(Class c1, TypeVariable t2) static booleanboundMatch(TypeVariable t1, TypeVariable t2) static booleanclassMatchesClassWithParameters(Class clazz, Class requiredType, Type[] requiredTypeParams) static booleanclassMatchesType(Class clazz, Type required) static <A extends Annotation,T>
Collection<T> collectAnnotatedMethods(Object consumer, Class<A> annotationCls, ReflectionHelper.Handler<A, T> handler) This method collects every method of consumer class annotated with passed annotation and for each of them executes implementation of Handler.static booleancompareTypes(Type expectedType, Type actualType, Map<TypeVariable<?>, Type> ownerExpectedTypesMap, Map<TypeVariable<?>, Type> ownerActualTypesMap) static Map<TypeVariable<?>, Type> createGenericsTypeMap(Class<?> cls) static TypegetCollectionParamter(Type genericType, Class clazz) static Class<?>
-
Constructor Details
-
ReflectionHelper
public ReflectionHelper()
-
-
Method Details
-
boundMatch
-
boundMatch
-
classMatchesClassWithParameters
-
classMatchesType
-
collectAnnotatedMethods
public static <A extends Annotation,T> Collection<T> collectAnnotatedMethods(Object consumer, Class<A> annotationCls, ReflectionHelper.Handler<A, T> handler) This method collects every method of consumer class annotated with passed annotation and for each of them executes implementation of Handler. -
compareTypes
public static boolean compareTypes(Type expectedType, Type actualType, Map<TypeVariable<?>, Type> ownerExpectedTypesMap, Map<TypeVariable<?>, Type> ownerActualTypesMap) -
createGenericsTypeMap
-
getCollectionParamter
-
getItemClassOfGenericCollection
-