KickJava   Java API By Example, From Geeks To Geeks.

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


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.EnumConstantDeclaration;
15 import com.sun.mirror.declaration.EnumDeclaration;
16 import com.sun.mirror.util.DeclarationVisitor;
17
18 import org.eclipse.jdt.apt.core.internal.env.BaseProcessorEnv;
19 import org.eclipse.jdt.core.dom.IVariableBinding;
20
21 public class EnumConstantDeclarationImpl extends FieldDeclarationImpl implements EnumConstantDeclaration
22 {
23     public EnumConstantDeclarationImpl(IVariableBinding binding, BaseProcessorEnv env)
24     {
25         super(binding, env);
26         assert binding.isEnumConstant() : "binding does not represent an enum constant"; //$NON-NLS-1$
27
}
28
29     public void accept(DeclarationVisitor visitor)
30     {
31         visitor.visitEnumConstantDeclaration(this);
32     }
33
34     public EnumDeclaration getDeclaringType()
35     {
36         return (EnumDeclaration)super.getDeclaringType();
37     }
38
39     public MirrorKind kind(){ return MirrorKind.ENUM_CONSTANT; }
40 }
41
Popular Tags