|
Eclipse JDT Release 3.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Represents a source type in a compilation unit, either as a top-level type or a member type. The corresponding syntactic units are ClassDeclaration (JLS2 8.1) and InterfaceDeclaration (JLS2 9.1). Enumeration types and annotation types, added in J2SE 1.5, are represented as classes and interfaces, respectively.
Allowable child types for a type are IDOMType
, IDOMField
,
IDOMMethod
, and IDOMInitializer
.
Children are listed in the order in which they appear in the source. The parent of a type
is a type (in the case of a member type) or a compilation unit (in the case of a top-level type).
This interface is not intended to be implemented by clients.
Field Summary |
Fields inherited from interface org.eclipse.jdt.core.jdom.IDOMNode |
COMPILATION_UNIT, FIELD, IMPORT, INITIALIZER, METHOD, PACKAGE, TYPE |
Method Summary | |
void |
addSuperInterface(String interfaceName)
Deprecated. Adds the given interface name to the names of interfaces that this type implements or extends (the name will be added after the existing interface names). |
String |
getName()
Deprecated. The IDOMType refinement of this IDOMNode
method returns the name of this type. |
String |
getSuperclass()
Deprecated. Returns the name of this type's superclass. |
String[] |
getSuperInterfaces()
Deprecated. Returns the names of interfaces that this type implements or extends, in the order in which they are listed in the source, or an empty array if no superinterfaces are present. |
String[] |
getTypeParameters()
Deprecated. Returns the formal type parameters for this type. |
boolean |
isAnnotation()
Deprecated. Returns whether this type represents an annotation type ("@interface" instead of "interface"). |
boolean |
isClass()
Deprecated. Returns whether this type is a class. |
boolean |
isEnum()
Deprecated. Returns whether this type represents an enumeration class ("enum" instead of "class"). |
void |
setAnnotation(boolean b)
Deprecated. Sets whether this type represents an annotation type ("@interface" instead of "interface"). |
void |
setClass(boolean b)
Deprecated. Sets whether this type is a class or an interface. |
void |
setEnum(boolean b)
Deprecated. Sets whether this type represents an enumeration class. |
void |
setName(String name)
Deprecated. The IDOMType refinement of this IDOMNode
method sets the name of this type. |
void |
setSuperclass(String superclassName)
Deprecated. Sets the name of this type's superclass. |
void |
setSuperInterfaces(String[] interfaceNames)
Deprecated. Sets the names of interfaces that this type implements or extends, in the order in which they are to be listed in the source. |
void |
setTypeParameters(String[] typeParameters)
Deprecated. Sets the formal type parameters for this type. |
Methods inherited from interface org.eclipse.jdt.core.jdom.IDOMMember |
getComment, getFlags, setComment, setFlags |
Methods inherited from interface org.eclipse.jdt.core.jdom.IDOMNode |
addChild, canHaveChildren, clone, getCharacters, getChild, getChildren, getContents, getFirstChild, getJavaElement, getNextNode, getNodeType, getParent, getPreviousNode, insertSibling, isAllowableChild, isSignatureEqual, remove |
Method Detail |
public void addSuperInterface(String interfaceName) throws IllegalArgumentException
interfaceName
- the syntax for an interface name is defined by
Interfaces in ClassDeclaration (JLS2 8.1). Type names must be specified as they would
appear in source code. For example: "Cloneable", "java.io.Serializable".
IllegalArgumentException
- if null
is specifiedpublic String[] getTypeParameters()
Formal type parameters are as they appear in the source
code; for example:
"X extends List<String> & Serializable"
.
public String getName()
IDOMType
refinement of this IDOMNode
method returns the name of this type. The name of a class is defined by
ClassDeclaration (JLS2 8.1); the name of an interface is defined by
InterfaceDeclaration (JLS2 9.1).
getName
in interface IDOMNode
public String getSuperclass()
"Object"
, or "java.io.File"
.
As of J2SE 1.5, the superclass may also include parameterized
types like "ArrayList<String>"
.
null
if this type represents
an interface or if no superclass has been assigned to this classpublic String[] getSuperInterfaces()
"Cloneable"
,
or "java.io.Serializable"
.
As of J2SE 1.5, superinterfaces may also include parameterized
types like "List<String>"
.
For classes, this method returns the interfaces that this class implements. For interfaces, this method returns the interfaces that this interface extends.
public boolean isClass()
true
for classes, and false
for interfacespublic boolean isEnum()
public boolean isAnnotation()
public void setClass(boolean b)
null
. When a class becomes an interface or an
interface becomes a class, superinterfaces remain (as part of an
implements
clause for classes, or an extends
clause for interfaces).
b
- true
for classes, and false
for interfacespublic void setEnum(boolean b)
null
.
If this type is an interface (including an annotation type),
and is changed to an enum, this type is also changed to a class.
b
- true
for enum classes, and false
otherwisepublic void setAnnotation(boolean b)
null
and its superinterface list
becomes empty. If this type is an class (including an enum),
and is changed to an annotation type, this type is also changed to an interface.
b
- true
for an annotation type, and false
otherwisepublic void setTypeParameters(String[] typeParameters)
Formal type parameters are given as they appear in the source
code; for example:
"X extends List<String> & Serializable"
.
typeParameters
- the formal type parameters of this type,
in the order to appear in the source, an empty array if nonepublic void setName(String name) throws IllegalArgumentException
IDOMType
refinement of this IDOMNode
method sets the name of this type. The name of a class is defined by
ClassDeclaration (JLS2 8.1); the name of an interface is defined by
InterfaceDeclaration (JLS2 9.1).
setName
in interface IDOMNode
name
- the given name
IllegalArgumentException
- if null
is specifiedpublic void setSuperclass(String superclassName)
null
name indicates that no
superclass name (extends clause) should appear in the source code.
The syntax for a superclass name is specified by Super in ClassDeclaration
(JLS2 8.1). Type names must be specified as they would appear in source code.
For example: "Object"
, or "java.io.File"
.
As of J2SE 1.5, the superclass may also include parameterized
types like "ArrayList<String>"
.
superclassName
- the superclass name, or null
if this type
should have to no explicitly specified superclasspublic void setSuperInterfaces(String[] interfaceNames)
"Cloneable"
, or "java.io.Serializable"
.
As of J2SE 1.5, superinterfaces may also include parameterized
types like "List<String>"
.
For classes, this method sets the interfaces that this class implements. For interfaces, this method sets the interfaces that this interface extends.
interfaceNames
- the list of interface names
|
Eclipse JDT Release 3.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |