A massive organize imports and formatting of the sources using default Eclipse code...
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / core / jdom / IDOMType.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 source type in a compilation unit, either as a top-level type or
15  * a member type. The corresponding syntactic units are ClassDeclaration (JLS2
16  * 8.1) and InterfaceDeclaration (JLS2 9.1).
17  * <p>
18  * Allowable child types for a type are <code>IDOMType</code>,
19  * <code>IDOMField</code>, <code>IDOMMethod</code>, and
20  * <code>IDOMInitializer</code>. Children are listed in the order in which
21  * they appear in the source. The parent of a type is a type (in the case of a
22  * member type) or a compilation unit (in the case of a top-level type).
23  * </p>
24  * <p>
25  * This interface is not intended to be implemented by clients.
26  * </p>
27  */
28 public interface IDOMType extends IDOMMember {
29         /**
30          * Adds the given interface name to the names of interfaces that this type
31          * implements or extends (the name will be added after the existing
32          * interface names). This is a convenience method.
33          * 
34          * For classes, this represents the interfaces that this class implements.
35          * For interfaces, this represents the interfaces that this interface
36          * extends. The name may or may not be fully qualified.
37          * 
38          * @param interfaceName
39          *            the syntax for an interface name is defined by Interfaces in
40          *            ClassDeclaration (JLS2 8.1). Type names must be specified as
41          *            they would appear in source code. For example: "Cloneable",
42          *            "java.io.Serializable".
43          * 
44          * @exception IllegalArgumentException
45          *                if <code>null</code> is specified
46          */
47         public void addSuperInterface(String interfaceName)
48                         throws IllegalArgumentException;
49
50         /**
51          * The <code>IDOMType</code> refinement of this <code>IDOMNode</code>
52          * method returns the name of this type. The name of a class is defined by
53          * ClassDeclaration (JLS2 8.1); the name of an interface is defined by
54          * InterfaceDeclaration (JLS2 9.1).
55          */
56         public String getName();
57
58         /**
59          * Returns the name of this type's superclass. The syntax for a superclass
60          * name is specified by Super in ClassDeclaration (JLS2 8.1). Type names
61          * must be specified as they would appear in source code. For example:
62          * <code>"Object"</code>, or <code>"java.io.File"</code>.
63          * 
64          * @return the superclass name, or <code>null</code> if this type
65          *         represents an interface or if no superclass has been assigned to
66          *         this class
67          */
68         public String getSuperclass();
69
70         /**
71          * Returns the names of interfaces that this type implements or extends, in
72          * the order in which they are listed in the source, or an empty array if no
73          * superinterfaces are present. The syntax for interface names is defined by
74          * Interfaces in ClassDeclaration (JLS2 8.1). Type names appear as they
75          * would in source code. For example: <code>"Cloneable"</code>, or
76          * <code>"java.io.Serializable"</code>.
77          * <p>
78          * For classes, this method returns the interfaces that this class
79          * implements. For interfaces, this method returns the interfaces that this
80          * interface extends.
81          * </p>
82          * 
83          * @return the list of interface names
84          */
85         public String[] getSuperInterfaces();
86
87         /**
88          * Returns whether this type is a class.
89          * 
90          * @return <code>true</code> for classes, and <code>false</code> for
91          *         interfaces
92          */
93         public boolean isClass();
94
95         /**
96          * Sets whether this type is a class or an interface. If this type is a
97          * class, and is changed to an interface, this type's superclass becomes
98          * <code>null</code>. When a class becomes an interface or an interface
99          * becomes a class, superinterfaces remain (as part of an
100          * <code>implements</code> clause for classes, or an <code>extends</code>
101          * clause for interfaces).
102          * 
103          * @param b
104          *            <code>true</code> for classes, and <code>false</code> for
105          *            interfaces
106          */
107         public void setClass(boolean b);
108
109         /**
110          * The <code>IDOMType</code> refinement of this <code>IDOMNode</code>
111          * method sets the name of this type. The name of a class is defined by
112          * ClassDeclaration (JLS2 8.1); the name of an interface is defined by
113          * InterfaceDeclaration (JLS2 9.1).
114          * 
115          * @exception IllegalArgumentException
116          *                if <code>null</code> is specified
117          */
118         public void setName(String name) throws IllegalArgumentException;
119
120         /**
121          * Sets the name of this type's superclass. Has no effect if this type
122          * represents an interface. A <code>null</code> name indicates that no
123          * superclass name (extends clause) should appear in the source code. The
124          * syntax for a superclass name is specified by Super in ClassDeclaration
125          * (JLS2 8.1). Type names must be specified as they would appear in source
126          * code. For example: <code>"Object"</code>, or
127          * <code>"java.io.File"</code>.
128          * 
129          * @param superclassName
130          *            the superclass name, or <code>null</code> if this type
131          *            should have to no explicitly specified superclass
132          */
133         public void setSuperclass(String superclassName);
134
135         /**
136          * Sets the names of interfaces that this type implements or extends, in the
137          * order in which they are to be listed in the source. An empty array
138          * parameter indicates that no superinterfaces are present. The syntax for
139          * interface names is defined by Interfaces in ClassDeclaration (JLS2 8.1).
140          * Type names appear as they would in source code. For example:
141          * <code>"Cloneable"</code>, or <code>"java.io.Serializable"</code>.
142          * <p>
143          * For classes, this method sets the interfaces that this class implements.
144          * For interfaces, this method sets the interfaces that this interface
145          * extends.
146          * </p>
147          * 
148          * @param interfaceNames
149          *            the list of interface names
150          */
151         public void setSuperInterfaces(String[] interfaceNames);
152 }