1 /*******************************************************************************
2 * Copyright (c) 2000, 2004 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Common Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/cpl-v10.html
9 * IBM Corporation - initial API and implementation
10 *******************************************************************************/
11 package org.eclipse.jdt.internal.compiler.ast;
13 import org.eclipse.jdt.internal.compiler.ASTVisitor;
14 import org.eclipse.jdt.internal.compiler.lookup.*;
17 * Normal annotation node
19 public class NormalAnnotation extends Annotation {
21 public MemberValuePair[] memberValuePairs;
23 public NormalAnnotation(TypeReference type, int sourceStart) {
25 this.sourceStart = sourceStart;
26 this.sourceEnd = type.sourceEnd;
30 * @see org.eclipse.jdt.internal.compiler.ast.Annotation#memberValuePairs()
32 public MemberValuePair[] memberValuePairs() {
33 return this.memberValuePairs == null ? NoValuePairs : this.memberValuePairs;
35 public StringBuffer printExpression(int indent, StringBuffer output) {
36 super.printExpression(indent, output);
38 if (this.memberValuePairs != null) {
39 for (int i = 0, max = this.memberValuePairs.length; i < max; i++) {
43 this.memberValuePairs[i].print(indent, output);
50 public void traverse(ASTVisitor visitor, BlockScope scope) {
51 if (visitor.visit(this, scope)) {
52 if (this.memberValuePairs != null) {
53 int memberValuePairsLength = this.memberValuePairs.length;
54 for (int i = 0; i < memberValuePairsLength; i++)
55 this.memberValuePairs[i].traverse(visitor, scope);
58 visitor.endVisit(this, scope);
60 public void traverse(ASTVisitor visitor, CompilationUnitScope scope) {
61 if (visitor.visit(this, scope)) {
62 if (this.memberValuePairs != null) {
63 int memberValuePairsLength = this.memberValuePairs.length;
64 for (int i = 0; i < memberValuePairsLength; i++)
65 this.memberValuePairs[i].traverse(visitor, scope);
68 visitor.endVisit(this, scope);