01: /*******************************************************************************
02: * Copyright (c) 2000, 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.jdt.core.jdom;
11:
12: /**
13: * Represents a field declaration. The corresponding
14: * syntactic units are FieldDeclaration (JLS2 8.3) and ConstantDeclaration
15: * (JLS2 9.3) restricted to a single VariableDeclarator clause.
16: * A field has no children. The parent of a field is a type.
17: * <p>
18: * This interface is not intended to be implemented by clients.
19: * </p>
20: * @deprecated The JDOM was made obsolete by the addition in 2.0 of the more
21: * powerful, fine-grained DOM/AST API found in the
22: * org.eclipse.jdt.core.dom package.
23: */
24: public interface IDOMField extends IDOMMember {
25: /**
26: * Returns the initializer expression for this field.
27: * The syntax for an initializer corresponds to VariableInitializer (JLS2 8.3).
28: * <p>
29: * Note: The expression does not include a "<code>=</code>".
30: * </p>
31: *
32: * @return the initializer expression, or <code>null</code> if this field does
33: * not have an initializer
34: */
35: public String getInitializer();
36:
37: /**
38: * The <code>IDOMField</code> refinement of this <code>IDOMNode</code>
39: * method returns the name of this field. The syntax for the name of a field
40: * corresponds to VariableDeclaratorId (JLS2 8.3).
41: *
42: * @return the name of this field
43: */
44: public String getName();
45:
46: /**
47: * Returns the type name of this field. The syntax for a type name of a field
48: * corresponds to Type in Field Declaration (JLS2 8.3).
49: *
50: * @return the type name
51: */
52: public String getType();
53:
54: /**
55: * Sets the initializer expression for this field.
56: * The syntax for an initializer corresponds to VariableInitializer (JLS2 8.3).
57: * <p>
58: * Note: The expression does not include a "<code>=</code>".
59: * </p>
60: *
61: * @param initializer the initializer expression, or <code>null</code> indicating
62: * the field does not have an initializer
63: */
64: public void setInitializer(String initializer);
65:
66: /**
67: * The <code>IDOMField</code> refinement of this <code>IDOMNode</code>
68: * method sets the name of this field. The syntax for the name of a field
69: * corresponds to VariableDeclaratorId (JLS2 8.3).
70: *
71: * @param name the given name
72: * @exception IllegalArgumentException if <code>null</code> is specified
73: */
74: public void setName(String name) throws IllegalArgumentException;
75:
76: /**
77: * Sets the type name of this field. The syntax for a type name of a field
78: * corresponds to Type in Field Declaration (JLS2 8.3). Type names must be
79: * specified as they should appear in source code. For example:
80: * <code>"String"</code>, <code>"int[]"</code>, or <code>"java.io.File"</code>.
81: *
82: * @param typeName the type name
83: * @exception IllegalArgumentException if <code>null</code> is specified
84: */
85: public void setType(String typeName)
86: throws IllegalArgumentException;
87: }
|