KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > core > SourceFieldElementInfo


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 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.core;
12
13 import org.eclipse.jdt.core.Signature;
14 import org.eclipse.jdt.internal.compiler.env.ISourceField;
15
16 /**
17  * Element info for IField elements.
18  */

19
20 public class SourceFieldElementInfo extends MemberElementInfo implements ISourceField {
21     
22     /**
23      * The type name of this field.
24      */

25     protected char[] typeName;
26     
27     /**
28      * The field's initializer string (if the field is a constant).
29      */

30     protected char[] initializationSource;
31
32 /*
33  * Returns the initialization source for this field.
34  * Returns null if the field is not a constant or if it has no initialization.
35  */

36 public char[] getInitializationSource() {
37     return this.initializationSource;
38 }
39 /**
40  * Returns the type name of the field.
41  */

42 public char[] getTypeName() {
43     return this.typeName;
44 }
45 /**
46  * Returns the type signature of the field.
47  *
48  * @see Signature
49  */

50 protected String JavaDoc getTypeSignature() {
51     return Signature.createTypeSignature(this.typeName, false);
52 }
53
54 /**
55  * Sets the type name of the field.
56  */

57 protected void setTypeName(char[] typeName) {
58     this.typeName = typeName;
59 }
60 }
61
Popular Tags