new version with WorkingCopy Management
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / core / jdom / IDOMField.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.core.jdom;
12
13 /**
14  * Represents a field declaration. The corresponding
15  * syntactic units are FieldDeclaration (JLS2 8.3) and ConstantDeclaration
16  * (JLS2 9.3) restricted to a single VariableDeclarator clause.
17  * A field has no children. The parent of a field is a type.
18  * <p>
19  * This interface is not intended to be implemented by clients.
20  * </p>
21  */
22 public interface IDOMField extends IDOMMember {
23 /**
24  * Returns the initializer expression for this field.
25  * The syntax for an initializer corresponds to VariableInitializer (JLS2 8.3). 
26  * <p>
27  * Note: The expression does not include a "<code>=</code>".
28  * </p>
29  *
30  * @return the initializer expression, or <code>null</code> if this field does
31  *    not have an initializer
32  */
33 public String getInitializer();
34 /**
35  * The <code>IDOMField</code> refinement of this <code>IDOMNode</code>
36  * method returns the name of this field. The syntax for the name of a field
37  * corresponds to VariableDeclaratorId (JLS2 8.3).
38  */
39 public String getName();
40 /**
41  * Returns the type name of this field. The syntax for a type name of a field
42  * corresponds to Type in Field Declaration (JLS2 8.3).
43  *
44  * @return the type name
45  */
46 public String getType();
47 /**
48  * Sets the initializer expression for this field.
49  * The syntax for an initializer corresponds to VariableInitializer (JLS2 8.3). 
50  * <p>
51  * Note: The expression does not include a "<code>=</code>".
52  * </p>
53  *
54  * @param initializer the initializer expression, or <code>null</code> indicating
55  *   the field does not have an initializer
56  */
57 public void setInitializer(String initializer);
58 /**
59  * The <code>IDOMField</code> refinement of this <code>IDOMNode</code>
60  * method sets the name of this field. The syntax for the name of a field
61  * corresponds to VariableDeclaratorId (JLS2 8.3).
62  *
63  * @exception IllegalArgumentException if <code>null</code> is specified
64  */
65 public void setName(String name) throws IllegalArgumentException;
66 /**
67  * Sets the type name of this field. The syntax for a type name of a field
68  * corresponds to Type in Field Declaration (JLS2 8.3). Type names must be 
69  * specified as they should appear in source code. For example: 
70  * <code>"String"</code>, <code>"int[]"</code>, or <code>"java.io.File"</code>.
71  *
72  * @param typeName the type name
73  * @exception IllegalArgumentException if <code>null</code> is specified
74  */
75 public void setType(String typeName) throws IllegalArgumentException;
76 }