KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > codeassist > complete > CompletionOnAnnotationOfType


1 /*******************************************************************************
2  * Copyright (c) 2004, 2007 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.jdt.internal.codeassist.complete;
12
13 import org.eclipse.jdt.internal.compiler.CompilationResult;
14 import org.eclipse.jdt.internal.compiler.ast.ASTNode;
15 import org.eclipse.jdt.internal.compiler.ast.Annotation;
16 import org.eclipse.jdt.internal.compiler.ast.TypeDeclaration;
17
18 public class CompletionOnAnnotationOfType extends TypeDeclaration {
19     public ASTNode potentialAnnotatedNode;
20     // During recovery a parameter can be parsed as a FieldDeclaration instead of Argument.
21
// 'isParameter' is set to true in this case.
22
public boolean isParameter;
23     
24     public CompletionOnAnnotationOfType(char[] typeName, 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 JavaDoc print(int indent, StringBuffer JavaDoc output) {
33         return this.annotations[0].print(indent, output);
34     }
35 }
36
Popular Tags