java isAssignableFrom,isInstance,AnnotationUtils.findAnnotation用法讲解

isInstance方法的用法:

QyConstrPerfor qyConstrPerfor = new QyConstrPerfor();

QyConstrPerfor.class.isInstance(qyConstrPerfor) //判断某个对象是否是属于某个类

isAssignableFrom:

QyConstrPerfor.class.isAssignableFrom(QyConstrPerfor.class)//判断某个类是否属于某个类 (后者属于前者)

AnnotationUtils.findAnnotation:

AnnotationUtils.findAnnotation(QyQualCheckCancelController.class, ResponseBody.class) != null

查找第一个参数类中,是否涵盖ResponseBody注解。如果有,就返回此注解,没有就返回空

你可能感兴趣的:(java)