ParameterizedType.getRawType() has the following syntax.
Type getRawType()
In the following code shows how to use ParameterizedType.getRawType() method.
import java.lang.reflect.ParameterizedType; import java.lang.reflect.Type; import java.util.ArrayList; /* ww w.ja v a 2 s.c o m*/ public class Main { public static void main(String args[]) throws Exception { Type type = StringList.class.getGenericSuperclass(); System.out.println(type); ParameterizedType pt = (ParameterizedType) type; Type rawType = pt.getRawType(); System.out.println(rawType); } } class StringList extends ArrayList<String> { }
The code above generates the following result.