Code example for AnnotatedElement

Methods: getAnnotation

		try { 
			annotationType = Class.forName(annotationTypeName);
		} catch (Exception ex) {
			throw new IllegalArgumentException(ex);
		return element.getAnnotation(annotationType
	// Test program to print named annotation of named class 
	public static void main(String[] args) throws Exception {
		if (args.length != 2) {
					.println("Usage: java PrintAnnotation <class> <annotation>");
		String className = args[0];
		String annotationTypeName = args[1];
		Class<?> klass = Class.forName(className);
		System.out.println(getAnnotation(klass, annotationTypeName));
Connect your IDE to all the code out there  Get Codota for Java