Example usage for org.eclipse.jdt.internal.compiler.ast ASTNode resolveAnnotations

List of usage examples for org.eclipse.jdt.internal.compiler.ast ASTNode resolveAnnotations

Introduction

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

Prototype

public static TypeBinding resolveAnnotations(BlockScope scope, Annotation[][] sourceAnnotations,
        TypeBinding type) 

Source Link

Document

Resolve JSR308 annotations on a type reference, array creation expression or a wildcard.

Usage

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

License:Open Source License

/**
 * Compute the tagbits for standard annotations. For source types, these could require
 * lazily resolving corresponding annotation nodes, in case of forward references.
 * @see org.eclipse.jdt.internal.compiler.lookup.Binding#getAnnotationTagBits()
 *//*from  w  w  w  . j a  va 2  s.  co  m*/
public long getAnnotationTagBits() {
    if ((this.tagBits & TagBits.AnnotationResolved) == 0 && this.scope != null) {
        TypeDeclaration typeDecl = this.scope.referenceContext;
        boolean old = typeDecl.staticInitializerScope.insideTypeAnnotation;
        try {
            typeDecl.staticInitializerScope.insideTypeAnnotation = true;
            ASTNode.resolveAnnotations(typeDecl.staticInitializerScope, typeDecl.annotations, this);
        } finally {
            typeDecl.staticInitializerScope.insideTypeAnnotation = old;
        }
        if ((this.tagBits & TagBits.AnnotationDeprecated) != 0)
            this.modifiers |= ClassFileConstants.AccDeprecated;
    }
    return this.tagBits;
}