KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > compiler > env > EnumConstantSignature


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 package org.eclipse.jdt.internal.compiler.env;
12
13 /**
14  * Represents a reference to a enum constant in the class file.
15  * One of the possible results for the default value of an annotation method.
16  */

17 public class EnumConstantSignature {
18
19     char[] typeName;
20     char[] constName;
21
22 public EnumConstantSignature(char[] typeName, char[] constName) {
23     this.typeName = typeName;
24     this.constName = constName;
25 }
26
27 /**
28  * @return name of the type in the class file format
29  */

30 public char[] getTypeName() {
31     return this.typeName;
32 }
33
34 /**
35  * @return the name of the enum constant reference.
36  */

37 public char[] getEnumConstantName() {
38     return this.constName;
39 }
40
41 public String JavaDoc toString() {
42     StringBuffer JavaDoc buffer = new StringBuffer JavaDoc();
43     buffer.append(this.typeName);
44     buffer.append('.');
45     buffer.append(this.constName);
46     return buffer.toString();
47 }
48 }
49
Popular Tags