org.springframework.core
Class ParameterizedTypeReference<T>
- java.lang.Object
-
- org.springframework.core.ParameterizedTypeReference<T>
public abstract class ParameterizedTypeReference<T> extends Object
The purpose of this class is to enable capturing and passing a genericType
. In order to capture the generic type and retain it at runtime, you need to create a subclass as follows:ParameterizedTypeReference<List<String>> typeRef = new ParameterizedTypeReference<List<String>>() {};
The resulting
typeReference
instance can then be used to obtain aType
instance that carries parameterized type information. For more information on "super type tokens" see the link to Neal Gafter's blog post.- Since:
- 3.2
- Author:
- Arjen Poutsma, Rossen Stoyanchev
- See Also:
- Neal Gafter on Super Type Tokens
-
Constructor Summary
Constructors Modifier Constructor and Description protected
ParameterizedTypeReference()