Example usage for org.eclipse.jdt.internal.compiler.ast Annotation getCompilerAnnotation

List of usage examples for org.eclipse.jdt.internal.compiler.ast Annotation getCompilerAnnotation

Introduction

In this page you can find the example usage for org.eclipse.jdt.internal.compiler.ast Annotation getCompilerAnnotation.

Prototype

public AnnotationBinding getCompilerAnnotation() 

Source Link

Usage

From source file:com.google.gwt.dev.javac.JdtUtil.java

License:Apache License

static AnnotationBinding getAnnotation(Annotation[] annotations, String nameToFind) {
    if (annotations != null) {
        for (Annotation a : annotations) {
            AnnotationBinding annBinding = a.getCompilerAnnotation();
            if (annBinding != null) {
                String annName = CharOperation.toString(annBinding.getAnnotationType().compoundName);
                if (nameToFind.equals(annName)) {
                    return annBinding;
                }/*w  w w .  jav  a  2 s.  c  o  m*/
            }
        }
    }
    return null;
}