f860639dd1e8590e1201ff74abcccaf56021d40f
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / core / SourceFieldElementInfo.java
1 /*******************************************************************************
2  * Copyright (c) 2000, 2003 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials 
4  * are made available under the terms of the Common Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/cpl-v10.html
7  * 
8  * Contributors:
9  *     IBM Corporation - initial API and implementation
10  *******************************************************************************/
11 package net.sourceforge.phpdt.internal.core;
12
13 import net.sourceforge.phpdt.core.Signature;
14 import net.sourceforge.phpdt.internal.compiler.env.ISourceField;
15
16 /**
17  * Element info for IField elements.
18  */
19
20 /* package */class SourceFieldElementInfo extends MemberElementInfo implements
21                 ISourceField {
22
23         /**
24          * The type name of this field.
25          */
26         protected char[] typeName;
27
28         /**
29          * The field's initializer string (if the field is a constant).
30          */
31         protected char[] initializationSource;
32
33         /*
34          * Returns the initialization source for this field. Returns null if the
35          * field is not a constant or if it has no initialization.
36          */
37         public char[] getInitializationSource() {
38                 return this.initializationSource;
39         }
40
41         /**
42          * Returns the type name of the field.
43          */
44         public char[] getTypeName() {
45                 return this.typeName;
46         }
47
48         /**
49          * Returns the type signature of the field.
50          * 
51          * @see Signature
52          */
53         protected String getTypeSignature() {
54                 return Signature.createTypeSignature(this.typeName, false);
55         }
56
57         /**
58          * Sets the type name of the field.
59          */
60         protected void setTypeName(char[] typeName) {
61                 this.typeName = typeName;
62         }
63 }