01: /*******************************************************************************
02: * Copyright (c) 2004, 2007 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.jdt.internal.codeassist.complete;
11:
12: import org.eclipse.jdt.internal.compiler.CompilationResult;
13: import org.eclipse.jdt.internal.compiler.ast.ASTNode;
14: import org.eclipse.jdt.internal.compiler.ast.Annotation;
15: import org.eclipse.jdt.internal.compiler.ast.TypeDeclaration;
16:
17: public class CompletionOnAnnotationOfType extends TypeDeclaration {
18: public ASTNode potentialAnnotatedNode;
19: // During recovery a parameter can be parsed as a FieldDeclaration instead of Argument.
20: // 'isParameter' is set to true in this case.
21: public boolean isParameter;
22:
23: public CompletionOnAnnotationOfType(char[] typeName,
24: CompilationResult compilationResult, Annotation annotation) {
25: super (compilationResult);
26: this .sourceEnd = annotation.sourceEnd;
27: this .sourceStart = annotation.sourceEnd;
28: this .name = typeName;
29: this .annotations = new Annotation[] { annotation };
30: }
31:
32: public StringBuffer print(int indent, StringBuffer output) {
33: return this .annotations[0].print(indent, output);
34: }
35: }
|