All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.checkerframework.javacutil.BasicAnnotationProvider Maven / Gradle / Ivy

package org.checkerframework.javacutil;

import com.sun.source.tree.Tree;
import java.lang.annotation.Annotation;
import java.util.List;
import javax.lang.model.element.AnnotationMirror;
import javax.lang.model.element.Element;

public class BasicAnnotationProvider implements AnnotationProvider {

    @Override
    public AnnotationMirror getDeclAnnotation(Element elt, Class anno) {
        List annotationMirrors = elt.getAnnotationMirrors();

        // Then look at the real annotations.
        for (AnnotationMirror am : annotationMirrors) {
            if (AnnotationUtils.areSameByClass(am, anno)) {
                return am;
            }
        }

        return null;
    }

    @Override
    public AnnotationMirror getAnnotationMirror(Tree tree, Class target) {
        return null;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy