KickJava   Java API By Example, From Geeks To Geeks.

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


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.InterfaceDeclaration;
15 import com.sun.mirror.declaration.MethodDeclaration;
16 import com.sun.mirror.type.InterfaceType;
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 InterfaceDeclarationImpl extends TypeDeclarationImpl implements InterfaceDeclaration, InterfaceType
25 {
26     public InterfaceDeclarationImpl(final ITypeBinding binding, final BaseProcessorEnv env)
27     {
28         super(binding, env);
29         assert binding.isInterface() : "binding does not represents an interface."; //$NON-NLS-1$
30
}
31
32     public void accept(DeclarationVisitor visitor)
33     {
34         visitor.visitInterfaceDeclaration(this);
35     }
36
37     public Collection JavaDoc<? extends MethodDeclaration> getMethods()
38     {
39         return _getMethods();
40     }
41
42     // start of implementation of InterfaceType API
43
public void accept(TypeVisitor visitor)
44     {
45         visitor.visitInterfaceType(this);
46     }
47
48     public InterfaceDeclaration getDeclaration()
49     {
50         return (InterfaceDeclaration)super.getDeclaration();
51     }
52     // end of implementation of InterfaceType API
53

54     public MirrorKind kind(){ return MirrorKind.TYPE_INTERFACE; }
55 }
56
Popular Tags