KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > apt > core > internal > declaration > AnnotationDeclarationImpl


1 /*******************************************************************************
2  * Copyright (c) 2005, 2007 BEA Systems, Inc.
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  * tyeung@bea.com - initial API and implementation
10  *******************************************************************************/

11
12 package org.eclipse.jdt.apt.core.internal.declaration;
13
14 import com.sun.mirror.declaration.AnnotationTypeDeclaration;
15 import com.sun.mirror.declaration.AnnotationTypeElementDeclaration;
16 import com.sun.mirror.type.AnnotationType;
17 import com.sun.mirror.util.DeclarationVisitor;
18 import com.sun.mirror.util.TypeVisitor;
19 import java.util.Collection JavaDoc;
20
21 import org.eclipse.jdt.apt.core.internal.env.BaseProcessorEnv;
22 import org.eclipse.jdt.core.dom.ITypeBinding;
23
24 public class AnnotationDeclarationImpl extends InterfaceDeclarationImpl implements AnnotationTypeDeclaration, AnnotationType
25 {
26     public AnnotationDeclarationImpl(final ITypeBinding binding, final BaseProcessorEnv env)
27     {
28         super(binding, env);
29         assert binding.isAnnotation() : "binding does not represent a annotation "; //$NON-NLS-1$
30
}
31
32     public void accept(DeclarationVisitor visitor)
33     {
34         visitor.visitAnnotationTypeDeclaration(this);
35     }
36
37     @SuppressWarnings JavaDoc("unchecked") // _getMethods() return type is too broadly specified
38
public Collection JavaDoc<AnnotationTypeElementDeclaration> getMethods()
39     {
40         return (Collection JavaDoc<AnnotationTypeElementDeclaration>)_getMethods();
41     }
42
43     // start of implementation of AnnotationType API
44
public void accept(TypeVisitor visitor)
45     {
46         visitor.visitAnnotationType(this);
47     }
48
49     public AnnotationTypeDeclaration getDeclaration()
50     {
51         return (AnnotationTypeDeclaration)super.getDeclaration();
52     }
53     // end of implementation of AnnotationType API
54

55     public MirrorKind kind(){ return MirrorKind.TYPE_ANNOTATION; }
56 }
57
Popular Tags