---
title: "Create annotation"
author: "maflyp"
date: "2012-03-08T11:14:02Z"
tags: []
categories: ["编程语言"]
slug: "create-annotation"
draft: false
lastmod: "2012-03-08T11:14:02Z"
id: 1445652
url: "https://maflyp.iteye.com/blog/1445652"
---

//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;
		}
	}