package fff;
import java.lang.reflect.Array;
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.*;
public class annotation {
public static void main (String[] args)throws Exception{
Method method = annotation.class.getMethod("applyvertor", Vector.class);
Type[] type = method.getGenericParameterTypes(); //从方法中获取所有的参数
ParameterizedType Ptype = (ParameterizedType)type[0]; //取出第一个参数 注意接收数据的变量
print(Ptype.getRawType()); //获取的是原始数据类型
print(Ptype.getActualTypeArguments()[0]); //获取实际参数类型 因为只有一个 所以取零 这里是数组
// class java.util.Vector
// class java.util.Date
}
public static void applyvertor(Vector<Date> v){
}
public static void print(Object obj){
System.out.println(obj);
}
}