is Annotation Present for Annotated Element - Java java.lang.annotation

Java examples for java.lang.annotation:Annotation Element

Description

is Annotation Present for Annotated Element

Demo Code


//package com.java2s;
import java.lang.annotation.Annotation;
import java.lang.reflect.AnnotatedElement;

public class Main {
    public static boolean isAnnotationPresent(AnnotatedElement element,
            Class<? extends Annotation> annotation) {
        return element.isAnnotationPresent(annotation);
    }//from w  w w.j  a  v  a2  s .  c o m
}

Related Tutorials