protected Type processAndResolveType(Type superclass, Class<?> rawSuperclass) { if (superclass instanceof ParameterizedType) { ParameterizedType parameterizedSuperclass = (ParameterizedType) superclass; processTypeVariables(rawSuperclass.getTypeParameters(), parameterizedSuperclass.getActualTypeArguments()); return resolveType(parameterizedSuperclass); } else if (superclass instanceof Class<?>) { // this is not a parameterized type, nothing to resolve return superclass; } throw new RuntimeException("Unexpected type: " + superclass); }
protected Type processAndResolveType(Type superclass, Class<?> rawSuperclass) { if (superclass instanceof ParameterizedType) { ParameterizedType parameterizedSuperclass = (ParameterizedType) superclass; processTypeVariables(rawSuperclass.getTypeParameters(), parameterizedSuperclass.getActualTypeArguments()); return resolveType(parameterizedSuperclass); } else if (superclass instanceof Class<?>) { // this is not a parameterized type, nothing to resolve return superclass; } throw new RuntimeException("Unexpected type: " + superclass); }
protected Type processAndResolveType(Type superclass, Class<?> rawSuperclass) { if (superclass instanceof ParameterizedType) { ParameterizedType parameterizedSuperclass = (ParameterizedType) superclass; processTypeVariables(rawSuperclass.getTypeParameters(), parameterizedSuperclass.getActualTypeArguments()); return resolveType(parameterizedSuperclass); } else if (superclass instanceof Class<?>) { // this is not a parameterized type, nothing to resolve return superclass; } throw new RuntimeException("Unexpected type: " + superclass); }
protected Type processAndResolveType(Type superclass, Class<?> rawSuperclass) { if (superclass instanceof ParameterizedType) { ParameterizedType parameterizedSuperclass = (ParameterizedType) superclass; processTypeVariables(rawSuperclass.getTypeParameters(), parameterizedSuperclass.getActualTypeArguments()); return resolveType(parameterizedSuperclass); } else if (superclass instanceof Class<?>) { // this is not a parameterized type, nothing to resolve return superclass; } throw new RuntimeException("Unexpected type: " + superclass); }
protected Type processAndResolveType(Type superclass, Class<?> rawSuperclass) { if (superclass instanceof ParameterizedType) { ParameterizedType parameterizedSuperclass = (ParameterizedType) superclass; processTypeVariables(rawSuperclass.getTypeParameters(), parameterizedSuperclass.getActualTypeArguments()); return resolveType(parameterizedSuperclass); } else if (superclass instanceof Class<?>) { // this is not a parameterized type, nothing to resolve return superclass; } throw new RuntimeException("Unexpected type: " + superclass); }
protected Type processAndResolveType(Type superclass, Class<?> rawSuperclass) { if (superclass instanceof ParameterizedType) { ParameterizedType parameterizedSuperclass = (ParameterizedType) superclass; processTypeVariables(rawSuperclass.getTypeParameters(), parameterizedSuperclass.getActualTypeArguments()); return resolveType(parameterizedSuperclass); } else if (superclass instanceof Class<?>) { // this is not a parameterized type, nothing to resolve return superclass; } throw new RuntimeException("Unexpected type: " + superclass); }
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); } } }
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); } } }
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); } } }