public void traverse(ASTVisitor visitor, ClassScope scope) {
   if (visitor.visit(this, scope)) {
     if (this.annotations != null) {
       Annotation[] typeAnnotations = this.annotations[0];
       for (int i = 0, length = typeAnnotations == null ? 0 : typeAnnotations.length;
           i < length;
           i++) {
         typeAnnotations[i].traverse(visitor, scope);
       }
     }
     if (this.annotationsOnDimensions != null) {
       for (int i = 0, max = this.annotationsOnDimensions.length; i < max; i++) {
         Annotation[] annotations2 = this.annotationsOnDimensions[i];
         for (int j = 0, max2 = annotations2.length; j < max2; j++) {
           Annotation annotation = annotations2[j];
           annotation.traverse(visitor, scope);
         }
       }
     }
     for (int i = 0, max = this.typeArguments.length; i < max; i++) {
       this.typeArguments[i].traverse(visitor, scope);
     }
   }
   visitor.endVisit(this, scope);
 }
示例#2
0
 public void getAllAnnotationContexts(
     int targetType, int info, List allAnnotationContexts, Annotation[] se7Annotations) {
   AnnotationCollector collector =
       new AnnotationCollector(this, targetType, info, allAnnotationContexts);
   for (int i = 0, length = se7Annotations == null ? 0 : se7Annotations.length; i < length; i++) {
     Annotation annotation = se7Annotations[i];
     annotation.traverse(collector, (BlockScope) null);
   }
   this.traverse(collector, (BlockScope) null);
 }