/**
* Validates contained value against its member definition
* and if ok returns the value.
* Otherwise, if the value type mismatches definition
* or the value itself describes an error,
* throws appropriate exception.
* <br> Note, this method may return null if this element was constructed
* with such value.
*
* @see #rethrowError()
* @see #copyValue()
* @return actual valid value or null if no value
*/
public Object validateValue() throws Throwable {
if (tag == ERROR) {
rethrowError();
}
if (value == NO_VALUE) {
return null;
}
if (elementType == value.getClass()
|| elementType.isInstance(value)) { // nested annotation value
return copyValue();
} else {
throw new AnnotationTypeMismatchException(definingMethod,
value.getClass().getName());
}
}
AnnotationMember.java 文件源码
java
阅读 33
收藏 0
点赞 0
评论 0
项目:freeVM
作者:
评论列表
文章目录