public HierarchyDiscovery(Type type, TypeResolver resolver) { this.types = new HashMap<Class<?>, Type>(); this.resolver = resolver; this.resolvedTypeVariables = resolver.getResolvedTypeVariables(); discoverTypes(type, false); }
protected void discoverInterfaces(Class<?> clazz, boolean rawGeneric) { Type[] genericInterfaces = clazz.getGenericInterfaces(); Class<?>[] interfaces = clazz.getInterfaces(); if (genericInterfaces.length == interfaces.length) { // this branch should execute every time! for (int i = 0; i < interfaces.length; i++) { discoverTypes(processAndResolveType(genericInterfaces[i], interfaces[i]), rawGeneric); } } }
protected void discoverInterfaces(Class<?> clazz, boolean rawGeneric) { Type[] genericInterfaces = clazz.getGenericInterfaces(); Class<?>[] interfaces = clazz.getInterfaces(); if (genericInterfaces.length == interfaces.length) { // this branch should execute every time! for (int i = 0; i < interfaces.length; i++) { discoverTypes(processAndResolveType(genericInterfaces[i], interfaces[i]), rawGeneric); } } }
protected void discoverInterfaces(Class<?> clazz, boolean rawGeneric) { Type[] genericInterfaces = clazz.getGenericInterfaces(); Class<?>[] interfaces = clazz.getInterfaces(); if (genericInterfaces.length == interfaces.length) { // this branch should execute every time! for (int i = 0; i < interfaces.length; i++) { discoverTypes(processAndResolveType(genericInterfaces[i], interfaces[i]), rawGeneric); } } }
protected void discoverInterfaces(Class<?> clazz, boolean rawGeneric) { Type[] genericInterfaces = clazz.getGenericInterfaces(); Class<?>[] interfaces = clazz.getInterfaces(); if (genericInterfaces.length == interfaces.length) { // this branch should execute every time! for (int i = 0; i < interfaces.length; i++) { discoverTypes(processAndResolveType(genericInterfaces[i], interfaces[i]), rawGeneric); } } }
protected void discoverInterfaces(Class<?> clazz, boolean rawGeneric) { Type[] genericInterfaces = clazz.getGenericInterfaces(); Class<?>[] interfaces = clazz.getInterfaces(); if (genericInterfaces.length == interfaces.length) { // this branch should execute every time! for (int i = 0; i < interfaces.length; i++) { discoverTypes(processAndResolveType(genericInterfaces[i], interfaces[i]), rawGeneric); } } }
protected void discoverInterfaces(Class<?> clazz, boolean rawGeneric) { Type[] genericInterfaces = clazz.getGenericInterfaces(); Class<?>[] interfaces = clazz.getInterfaces(); if (genericInterfaces.length == interfaces.length) { // this branch should execute every time! for (int i = 0; i < interfaces.length; i++) { discoverTypes(processAndResolveType(genericInterfaces[i], interfaces[i]), rawGeneric); } } }
protected void discoverFromClass(Class<?> clazz, boolean rawGeneric) { if (clazz.getSuperclass() != null) { discoverTypes(processAndResolveType(clazz.getGenericSuperclass(), clazz.getSuperclass()), rawGeneric); } discoverInterfaces(clazz, rawGeneric); }
public HierarchyDiscovery(Type type, TypeResolver resolver) { this.types = new HashMap<Class<?>, Type>(); this.resolver = resolver; this.resolvedTypeVariables = resolver.getResolvedTypeVariables(); discoverTypes(type, false); this.typeClosure = ImmutableSet.copyOf(types.values()); }
protected void discoverFromClass(Class<?> clazz, boolean rawGeneric) { if (clazz.getSuperclass() != null) { discoverTypes(processAndResolveType(clazz.getGenericSuperclass(), clazz.getSuperclass()), rawGeneric); } discoverInterfaces(clazz, rawGeneric); }
public HierarchyDiscovery(Type type, TypeResolver resolver) { this.types = new HashMap<Class<?>, Type>(); this.resolver = resolver; this.resolvedTypeVariables = resolver.getResolvedTypeVariables(); discoverTypes(type, false); this.typeClosure = ImmutableSet.copyOf(types.values()); }
public HierarchyDiscovery(Type type, TypeResolver resolver) { this.types = new HashMap<Class<?>, Type>(); this.resolver = resolver; this.resolvedTypeVariables = resolver.getResolvedTypeVariables(); discoverTypes(type, false); this.typeClosure = ImmutableSet.copyOf(types.values()); }
public HierarchyDiscovery(Type type, TypeResolver resolver) { this.types = new HashMap<Class<?>, Type>(); this.resolver = resolver; this.resolvedTypeVariables = resolver.getResolvedTypeVariables(); discoverTypes(type, false); this.typeClosure = ImmutableSet.copyOf(types.values()); }
protected void discoverFromClass(Class<?> clazz, boolean rawGeneric) { if (clazz.getSuperclass() != null) { discoverTypes(processAndResolveType(clazz.getGenericSuperclass(), clazz.getSuperclass()), rawGeneric); } discoverInterfaces(clazz, rawGeneric); }
protected void discoverFromClass(Class<?> clazz, boolean rawGeneric) { if (clazz.getSuperclass() != null) { discoverTypes(processAndResolveType(clazz.getGenericSuperclass(), clazz.getSuperclass()), rawGeneric); } discoverInterfaces(clazz, rawGeneric); }
protected void discoverFromClass(Class<?> clazz, boolean rawGeneric) { if (clazz.getSuperclass() != null) { discoverTypes(processAndResolveType(clazz.getGenericSuperclass(), clazz.getSuperclass()), rawGeneric); } discoverInterfaces(clazz, rawGeneric); }
protected void discoverFromClass(Class<?> clazz, boolean rawGeneric) { if (clazz.getSuperclass() != null) { discoverTypes(processAndResolveType(clazz.getGenericSuperclass(), clazz.getSuperclass()), rawGeneric); } discoverInterfaces(clazz, rawGeneric); }
public HierarchyDiscovery(Type type, TypeResolver resolver) { this.types = new HashMap<Class<?>, Type>(); this.resolver = resolver; this.resolvedTypeVariables = resolver.getResolvedTypeVariables(); discoverTypes(type, false); this.typeClosure = ImmutableSet.copyOf(types.values()); }
protected void discoverTypes(Type type, boolean rawGeneric) { if (!rawGeneric) { rawGeneric = Types.isRawGenericType(type); } if (type instanceof Class<?>) { Class<?> clazz = (Class<?>) type; this.types.put(clazz, clazz); discoverFromClass(clazz, rawGeneric); } else if (rawGeneric) { discoverTypes(Reflections.getRawType(type), rawGeneric); } else if (type instanceof GenericArrayType) { GenericArrayType arrayType = (GenericArrayType) type; Type genericComponentType = arrayType.getGenericComponentType(); Class<?> rawComponentType = Reflections.getRawType(genericComponentType); if (rawComponentType != null) { Class<?> arrayClass = Array.newInstance(rawComponentType, 0).getClass(); this.types.put(arrayClass, type); discoverFromClass(arrayClass, rawGeneric); } } else if (type instanceof ParameterizedType) { ParameterizedType parameterizedType = (ParameterizedType) type; Type rawType = (parameterizedType).getRawType(); if (rawType instanceof Class<?>) { Class<?> clazz = (Class<?>) rawType; processTypeVariables(clazz.getTypeParameters(), parameterizedType.getActualTypeArguments()); this.types.put(clazz, type); discoverFromClass(clazz, rawGeneric); } } }
protected void discoverTypes(Type type, boolean rawGeneric) { if (!rawGeneric) { rawGeneric = Types.isRawGenericType(type); } if (type instanceof Class<?>) { Class<?> clazz = (Class<?>) type; this.types.put(clazz, clazz); discoverFromClass(clazz, rawGeneric); } else if (rawGeneric) { discoverTypes(Reflections.getRawType(type), rawGeneric); } else if (type instanceof GenericArrayType) { GenericArrayType arrayType = (GenericArrayType) type; Type genericComponentType = arrayType.getGenericComponentType(); Class<?> rawComponentType = Reflections.getRawType(genericComponentType); if (rawComponentType != null) { Class<?> arrayClass = Array.newInstance(rawComponentType, 0).getClass(); this.types.put(arrayClass, type); discoverFromClass(arrayClass, rawGeneric); } } else if (type instanceof ParameterizedType) { ParameterizedType parameterizedType = (ParameterizedType) type; Type rawType = (parameterizedType).getRawType(); if (rawType instanceof Class<?>) { Class<?> clazz = (Class<?>) rawType; processTypeVariables(clazz.getTypeParameters(), parameterizedType.getActualTypeArguments()); this.types.put(clazz, type); discoverFromClass(clazz, rawGeneric); } } }