/** * Resolves the generic type of a field given the actual class being instantiated * * @param topclass The instantiation class. Must not be null * @param field The non-null field whose type to resolve * @return The resolved field type by way of its subclasses. Will not return * null, but may return the original fields generic type */ public static Type resolveField(Class<?> topclass, Field field) { return resolveMember(topclass, field.getGenericType(), field.getDeclaringClass()); }
/** * Resolves the generic type of a field given the actual class being instantiated * * @param topclass The instantiation class. Must not be null * @param field The non-null field whose type to resolve * @return The resolved field type by way of its subclasses. Will not return * null, but may return the original fields generic type */ public static Type resolveField(Class<?> topclass, Field field) { return resolveMember(topclass, field.getGenericType(), field.getDeclaringClass()); }
/** * Resolves the generic type of a field given the actual class being instantiated * * @param topclass The instantiation class. Must not be null * @param field The non-null field whose type to resolve * @return The resolved field type by way of its subclasses. Will not return * null, but may return the original fields generic type */ public static Type resolveField(Class<?> topclass, Field field) { return resolveMember(topclass, field.getGenericType(), field.getDeclaringClass()); }
/** * Resolves the generic type of a field given the actual class being instantiated * * @param topclass The instantiation class. Must not be null * @param field The non-null field whose type to resolve * @return The resolved field type by way of its subclasses. Will not return * null, but may return the original fields generic type */ public static Type resolveField(Class<?> topclass, Field field) { return resolveMember(topclass, field.getGenericType(), field.getDeclaringClass()); }
/** * Returns all the injectees for a constructor * @param c The constructor to analyze * @param injecteeDescriptor The descriptor of the injectee * @return the list (in order) of parameters to the constructor */ public static List<SystemInjecteeImpl> getMethodInjectees(Class<?> actualClass, Method c, ActiveDescriptor<?> injecteeDescriptor) { Type genericTypeParams[] = c.getGenericParameterTypes(); Annotation paramAnnotations[][] = c.getParameterAnnotations(); List<SystemInjecteeImpl> retVal = new LinkedList<SystemInjecteeImpl>(); Class<?> declaringClass = c.getDeclaringClass(); for (int lcv = 0; lcv < genericTypeParams.length; lcv++) { AnnotationInformation ai = getParamInformation(paramAnnotations[lcv]); Type adjustedType = ReflectionHelper.resolveMember(actualClass, genericTypeParams[lcv], declaringClass); retVal.add(new SystemInjecteeImpl(adjustedType, ai.qualifiers, lcv, c, ai.optional, ai.self, ai.unqualified, injecteeDescriptor)); } return retVal; }
/** * Returns all the injectees for a constructor * @param c The constructor to analyze * @param injecteeDescriptor The descriptor of the injectee * @return the list (in order) of parameters to the constructor */ public static List<SystemInjecteeImpl> getMethodInjectees(Class<?> actualClass, Method c, ActiveDescriptor<?> injecteeDescriptor) { Type genericTypeParams[] = c.getGenericParameterTypes(); Annotation paramAnnotations[][] = c.getParameterAnnotations(); List<SystemInjecteeImpl> retVal = new LinkedList<SystemInjecteeImpl>(); Class<?> declaringClass = c.getDeclaringClass(); for (int lcv = 0; lcv < genericTypeParams.length; lcv++) { AnnotationInformation ai = getParamInformation(paramAnnotations[lcv]); Type adjustedType = ReflectionHelper.resolveMember(actualClass, genericTypeParams[lcv], declaringClass); retVal.add(new SystemInjecteeImpl(adjustedType, ai.qualifiers, lcv, c, ai.optional, ai.self, ai.unqualified, injecteeDescriptor)); } return retVal; }
/** * Returns all the injectees for a constructor * @param c The constructor to analyze * @param injecteeDescriptor The descriptor of the injectee * @return the list (in order) of parameters to the constructor */ public static List<SystemInjecteeImpl> getMethodInjectees(Class<?> actualClass, Method c, ActiveDescriptor<?> injecteeDescriptor) { Type genericTypeParams[] = c.getGenericParameterTypes(); Annotation paramAnnotations[][] = c.getParameterAnnotations(); List<SystemInjecteeImpl> retVal = new LinkedList<SystemInjecteeImpl>(); Class<?> declaringClass = c.getDeclaringClass(); for (int lcv = 0; lcv < genericTypeParams.length; lcv++) { AnnotationInformation ai = getParamInformation(paramAnnotations[lcv]); Type adjustedType = ReflectionHelper.resolveMember(actualClass, genericTypeParams[lcv], declaringClass); retVal.add(new SystemInjecteeImpl(adjustedType, ai.qualifiers, lcv, c, ai.optional, ai.self, ai.unqualified, injecteeDescriptor)); } return retVal; }
Type adjustedType = ReflectionHelper.resolveMember(actualClass, genericTypeParams[lcv], declaringClass);