java.lang.Object
org.eclipse.yasson.internal.VariableTypeInheritanceSearch
Search for type variable in inheritance hierarchy and resolve if possible.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate Type
checkSubclassRuntimeInfo
(TypeVariable typeVar) private static ParameterizedType
(package private) Type
searchParametrizedType
(Type typeToSearch, TypeVariable<?> typeVar) Searches the hierarchy of classes to resolve a type variable.private Type
searchRuntimeTypeArgument
(ParameterizedType runtimeType, TypeVariable<?> typeVar)
-
Field Details
-
parameterizedSubclasses
-
-
Constructor Details
-
VariableTypeInheritanceSearch
VariableTypeInheritanceSearch()
-
-
Method Details
-
searchParametrizedType
Searches the hierarchy of classes to resolve a type variable. If typevar resolved value is another typevar redirection (propagated from wrapping class), this typevar is returned.Example 1: typevar is resolved class GenericClass <T> { private T genericField; } class ConcreteClass extends GenericClass<MyPojo> { //... } In above case when ConcreteClass type is passed as runtime type and <T> as type variable, T is resolved to MyPojo.
Example 2: typevar is resolved to another propagated typevar class WrapperGenericClass<X> { private GenericClass<X> propagatedGenericField } class AnotherClass extends WrapperGenericClass<MyPojo> { } In second case when GenericClass
ParameterizedType
is passed as runtime type and <T> as type variable, T is resolved to propagated <X> by WrapperGenericClass. Resolution on <X> must be performed thereafter with AnotherClass runtime type.- Parameters:
typeToSearch
- runtime type to search for typevar in, not nulltypeVar
- type variable to resolve, not null- Returns:
- resolved runtime type, or type variable
-
checkSubclassRuntimeInfo
-
searchRuntimeTypeArgument
-
findParameterizedSuperclass
-