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
9 * IBM Corporation - initial API and implementation
10 *******************************************************************************/
11 package net.sourceforge.phpdt.core.jdom;
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
19 * This interface is not intended to be implemented by clients.
22 public interface IDOMField extends IDOMMember {
24 * Returns the initializer expression for this field. The syntax for an
25 * initializer corresponds to VariableInitializer (JLS2 8.3).
27 * Note: The expression does not include a "<code>=</code>".
30 * @return the initializer expression, or <code>null</code> if this field
31 * does not have an initializer
33 public String getInitializer();
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).
40 public String getName();
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).
46 * @return the type name
48 public String getType();
51 * Sets the initializer expression for this field. The syntax for an
52 * initializer corresponds to VariableInitializer (JLS2 8.3).
54 * Note: The expression does not include a "<code>=</code>".
58 * the initializer expression, or <code>null</code> indicating
59 * the field does not have an initializer
61 public void setInitializer(String initializer);
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).
68 * @exception IllegalArgumentException
69 * if <code>null</code> is specified
71 public void setName(String name) throws IllegalArgumentException;
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>.
82 * @exception IllegalArgumentException
83 * if <code>null</code> is specified
85 public void setType(String typeName) throws IllegalArgumentException;