A massive organize imports and formatting of the sources using default Eclipse code...
[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 syntactic units are
15  * FieldDeclaration (JLS2 8.3) and ConstantDeclaration (JLS2 9.3) restricted to
16  * a single VariableDeclarator clause. A field has no children. The parent of a
17  * 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. The syntax for an
25          * 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
31          *         does not have an initializer
32          */
33         public String getInitializer();
34
35         /**
36          * The <code>IDOMField</code> refinement of this <code>IDOMNode</code>
37          * method returns the name of this field. The syntax for the name of a field
38          * corresponds to VariableDeclaratorId (JLS2 8.3).
39          */
40         public String getName();
41
42         /**
43          * Returns the type name of this field. The syntax for a type name of a
44          * field corresponds to Type in Field Declaration (JLS2 8.3).
45          * 
46          * @return the type name
47          */
48         public String getType();
49
50         /**
51          * Sets the initializer expression for this field. The syntax for an
52          * initializer corresponds to VariableInitializer (JLS2 8.3).
53          * <p>
54          * Note: The expression does not include a "<code>=</code>".
55          * </p>
56          * 
57          * @param initializer
58          *            the initializer expression, or <code>null</code> indicating
59          *            the field does not have an initializer
60          */
61         public void setInitializer(String initializer);
62
63         /**
64          * The <code>IDOMField</code> refinement of this <code>IDOMNode</code>
65          * method sets the name of this field. The syntax for the name of a field
66          * corresponds to VariableDeclaratorId (JLS2 8.3).
67          * 
68          * @exception IllegalArgumentException
69          *                if <code>null</code> is specified
70          */
71         public void setName(String name) throws IllegalArgumentException;
72
73         /**
74          * Sets the type name of this field. The syntax for a type name of a field
75          * corresponds to Type in Field Declaration (JLS2 8.3). Type names must be
76          * specified as they should appear in source code. For example:
77          * <code>"String"</code>, <code>"int[]"</code>, or
78          * <code>"java.io.File"</code>.
79          * 
80          * @param typeName
81          *            the type name
82          * @exception IllegalArgumentException
83          *                if <code>null</code> is specified
84          */
85         public void setType(String typeName) throws IllegalArgumentException;
86 }