ITeye博客

Create annotation

maflyp · 2012-03-08 11:14 · 编程语言 · Markdown

//create annotation @Target({ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) public @interface TransientMakeCheck {}

//check if method contains specific Annotation

private static boolean needMakeCheck(PropertyDescriptor propertyDescriptor) {
	Method readMethod = propertyDescriptor.getReadMethod();
	
	if (readMethod == null) {
		return false;
	} else {
		return readMethod.getAnnotation(TransientMakeCheck.class) == null;
	}
}

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。