Refine search
/** * Returns a canonical type for a given class. * * If the class is a raw type of a parameterized class, the matching {@link ParameterizedType} (with unresolved type * variables) is resolved. * * If the class is an array then the component type of the array is canonicalized * * Otherwise, the class is returned. * * @return */ public static Type getCanonicalType(Class<?> clazz) { if (clazz.isArray()) { Class<?> componentType = clazz.getComponentType(); Type resolvedComponentType = getCanonicalType(componentType); if (componentType != resolvedComponentType) { // identity check intentional // a different identity means that we actually replaced the component Class with a ParameterizedType return new GenericArrayTypeImpl(resolvedComponentType); } } if (clazz.getTypeParameters().length > 0) { Type[] actualTypeParameters = clazz.getTypeParameters(); return new ParameterizedTypeImpl(clazz, actualTypeParameters, clazz.getDeclaringClass()); } return clazz; }
return type; } else { return new GenericArrayTypeImpl(resolvedType);
return type; } else { return new GenericArrayTypeImpl(resolvedType);
/** * Returns a canonical type for a given class. * * If the class is a raw type of a parameterized class, the matching {@link ParameterizedType} (with unresolved type * variables) is resolved. * * If the class is an array then the component type of the array is canonicalized * * Otherwise, the class is returned. * * @return */ public static Type getCanonicalType(Class<?> clazz) { if (clazz.isArray()) { Class<?> componentType = clazz.getComponentType(); Type resolvedComponentType = getCanonicalType(componentType); if (componentType != resolvedComponentType) { // identity check intentional // a different identity means that we actually replaced the component Class with a ParameterizedType return new GenericArrayTypeImpl(resolvedComponentType); } } if (clazz.getTypeParameters().length > 0) { Type[] actualTypeParameters = clazz.getTypeParameters(); return new ParameterizedTypeImpl(clazz, actualTypeParameters, clazz.getDeclaringClass()); } return clazz; }
return type; } else { return new GenericArrayTypeImpl(resolvedType);
/** * Returns a canonical type for a given class. * * If the class is a raw type of a parameterized class, the matching {@link ParameterizedType} (with unresolved type * variables) is resolved. * * If the class is an array then the component type of the array is canonicalized * * Otherwise, the class is returned. * * @return */ public static Type getCanonicalType(Class<?> clazz) { if (clazz.isArray()) { Class<?> componentType = clazz.getComponentType(); Type resolvedComponentType = getCanonicalType(componentType); if (componentType != resolvedComponentType) { // identity check intentional // a different identity means that we actually replaced the component Class with a ParameterizedType return new GenericArrayTypeImpl(resolvedComponentType); } } if (clazz.getTypeParameters().length > 0) { Type[] actualTypeParameters = clazz.getTypeParameters(); return new ParameterizedTypeImpl(clazz, actualTypeParameters, clazz.getDeclaringClass()); } return clazz; }
return type; } else { return new GenericArrayTypeImpl(resolvedType);
/** * Returns a canonical type for a given class. * * If the class is a raw type of a parameterized class, the matching {@link ParameterizedType} (with unresolved type * variables) is resolved. * * If the class is an array then the component type of the array is canonicalized * * Otherwise, the class is returned. * * @return */ public static Type getCanonicalType(Class<?> clazz) { if (clazz.isArray()) { Class<?> componentType = clazz.getComponentType(); Type resolvedComponentType = getCanonicalType(componentType); if (componentType != resolvedComponentType) { // identity check intentional // a different identity means that we actually replaced the component Class with a ParameterizedType return new GenericArrayTypeImpl(resolvedComponentType); } } if (clazz.getTypeParameters().length > 0) { Type[] actualTypeParameters = clazz.getTypeParameters(); return new ParameterizedTypeImpl(clazz, actualTypeParameters, clazz.getDeclaringClass()); } return clazz; }
return type; } else { return new GenericArrayTypeImpl(resolvedType);
/** * Returns a canonical type for a given class. * * If the class is a raw type of a parameterized class, the matching {@link ParameterizedType} (with unresolved type * variables) is resolved. * * If the class is an array then the component type of the array is canonicalized * * Otherwise, the class is returned. * * @return */ public static Type getCanonicalType(Class<?> clazz) { if (clazz.isArray()) { Class<?> componentType = clazz.getComponentType(); Type resolvedComponentType = getCanonicalType(componentType); if (componentType != resolvedComponentType) { // identity check intentional // a different identity means that we actually replaced the component Class with a ParameterizedType return new GenericArrayTypeImpl(resolvedComponentType); } } if (clazz.getTypeParameters().length > 0) { Type[] actualTypeParameters = clazz.getTypeParameters(); return new ParameterizedTypeImpl(clazz, actualTypeParameters, clazz.getDeclaringClass()); } return clazz; }
return type; } else { return new GenericArrayTypeImpl(resolvedType);
/** * Returns a canonical type for a given class. * * If the class is a raw type of a parameterized class, the matching {@link ParameterizedType} (with unresolved type * variables) is resolved. * * If the class is an array then the component type of the array is canonicalized * * Otherwise, the class is returned. * * @return */ public static Type getCanonicalType(Class<?> clazz) { if (clazz.isArray()) { Class<?> componentType = clazz.getComponentType(); Type resolvedComponentType = getCanonicalType(componentType); if (componentType != resolvedComponentType) { // identity check intentional // a different identity means that we actually replaced the component Class with a ParameterizedType return new GenericArrayTypeImpl(resolvedComponentType); } } if (clazz.getTypeParameters().length > 0) { Type[] actualTypeParameters = clazz.getTypeParameters(); return new ParameterizedTypeImpl(clazz, actualTypeParameters, clazz.getDeclaringClass()); } return clazz; }
return null; return new GenericArrayTypeImpl(componentType); return new ParameterizedTypeImpl(rawRequiredType, typeParameters);
return null; return new GenericArrayTypeImpl(componentType); return new ParameterizedTypeImpl(rawRequiredType, typeParameters);
return null; return new GenericArrayTypeImpl(componentType); return new ParameterizedTypeImpl(rawRequiredType, typeParameters);
return null; return new GenericArrayTypeImpl(componentType); return new ParameterizedTypeImpl(rawRequiredType, typeParameters);
return null; return new GenericArrayTypeImpl(componentType); return new ParameterizedTypeImpl(rawRequiredType, typeParameters);
return null; return new GenericArrayTypeImpl(componentType); return new ParameterizedTypeImpl(rawRequiredType, typeParameters);
return null; return new GenericArrayTypeImpl(componentType); return new ParameterizedTypeImpl(rawRequiredType, typeParameters);