Example usage for org.eclipse.jdt.internal.compiler.lookup AnnotationHolder setAnnotations

List of usage examples for org.eclipse.jdt.internal.compiler.lookup AnnotationHolder setAnnotations

Introduction

In this page you can find the example usage for org.eclipse.jdt.internal.compiler.lookup AnnotationHolder setAnnotations.

Prototype

AnnotationHolder setAnnotations(AnnotationBinding[] annotations) 

Source Link

Usage

From source file:org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding.java

License:Open Source License

void storeAnnotations(Binding binding, AnnotationBinding[] annotations) {
    AnnotationHolder holder = null;
    if (annotations == null || annotations.length == 0) {
        SimpleLookupTable store = storedAnnotations(false);
        if (store != null)
            holder = (AnnotationHolder) store.get(binding);
        if (holder == null)
            return; // nothing to delete
    } else {/*from  w  w w . jav a  2 s  .c  om*/
        SimpleLookupTable store = storedAnnotations(true);
        if (store == null)
            return; // not supported
        holder = (AnnotationHolder) store.get(binding);
        if (holder == null)
            holder = new AnnotationHolder();
    }
    storeAnnotationHolder(binding, holder.setAnnotations(annotations));
}