public final class GenericInfoUtils
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static GenericsInfo |
create(java.lang.Class<?> type,
java.lang.Class<?>... ignoreClasses)
Root class analysis.
|
static GenericsInfo |
create(GenericsContext context,
java.lang.reflect.Type type,
java.lang.Class<?>... ignoreClasses)
Type analysis in context of analyzed type.
|
static GenericsInfo |
create(GenericsContext context,
java.lang.reflect.Type type,
java.lang.Class<?> asType,
java.lang.Class<?>... ignoreClasses)
Type analysis in context of analyzed type with child class as target type.
|
public static GenericsInfo create(java.lang.Class<?> type, java.lang.Class<?>... ignoreClasses)
The result must be cached.
type - class to analyzeignoreClasses - exclude classes from hierarchy analysispublic static GenericsInfo create(GenericsContext context, java.lang.reflect.Type type, java.lang.Class<?>... ignoreClasses)
The result is not intended to be cached as it's context-sensitive.
context - generics context of containing classtype - type to analyze (important: this must be generified type and not raw class in
order to properly resolve generics)ignoreClasses - classes to exclude from hierarchy analysispublic static GenericsInfo create(GenericsContext context, java.lang.reflect.Type type, java.lang.Class<?> asType, java.lang.Class<?>... ignoreClasses)
NOTE: some of the root generics could possibly be resolved if there are any traceable connectivity between
the root class and known middle generics. All possible (known) cases should be solved. For example,
Root<K> extends Target<List<K>> when we know Target<Collection<String>> then
K will be tracked as String.
In essence: root generics are partially resolved by tracking definition from known middle class. Other root generics resolved as upper bound (the same as in usual type resolution case). If middle type generic is not specified (and so resolved as Object) then known specific type used (assuming root type would be used in place with known parametrization and so more specifi generic may be counted).
The result is not intended to be cached as it's context-sensitive.
context - generics context of containing classtype - type to analyze (important: this must be generified type and not raw class in
order to properly resolve generics)asType - target child type (this class contain original type in hierarchy)ignoreClasses - classes to exclude from hierarchy analysis