Interface IDOMType
- All Superinterfaces:
Cloneable, IDOMMember, IDOMNode
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).
-
Field Summary
Fields inherited from interface IDOMNode
COMPILATION_UNIT, FIELD, IMPORT, INITIALIZER, METHOD, PACKAGE, TYPEModifier and TypeFieldDescriptionstatic final intDeprecated.Node type constant indicating a compilation unit.static final intDeprecated.Node type constant indicating a field declaration.static final intDeprecated.Node type constant indicating an import declaration.static final intDeprecated.Node type constant indicating an initializer declaration.static final intDeprecated.Node type constant indicating a method (or constructor) declaration.static final intDeprecated.Node type constant indicating a package declaration.static final intDeprecated.Node type constant indicating a type declaration. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSuperInterface(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).getName()Deprecated.TheIDOMTyperefinement of thisIDOMNodemethod returns the name of this type.Deprecated.Returns the name of this type's superclass.String[]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[]Deprecated.Returns the formal type parameters for this type.booleanDeprecated.Returns whether this type represents an annotation type ("@interface" instead of "interface").booleanisClass()Deprecated.Returns whether this type is a class.booleanisEnum()Deprecated.Returns whether this type represents an enumeration class ("enum" instead of "class").voidsetAnnotation(boolean b) Deprecated.Sets whether this type represents an annotation type ("@interface" instead of "interface").voidsetClass(boolean b) Deprecated.Sets whether this type is a class or an interface.voidsetEnum(boolean b) Deprecated.Sets whether this type represents an enumeration class.voidDeprecated.TheIDOMTyperefinement of thisIDOMNodemethod sets the name of this type.voidsetSuperclass(String superclassName) Deprecated.Sets the name of this type's superclass.voidsetSuperInterfaces(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.voidsetTypeParameters(String[] typeParameters) Deprecated.Sets the formal type parameters for this type.Methods inherited from interface IDOMMember
getComment, getFlags, setComment, setFlagsModifier and TypeMethodDescriptionDeprecated.Returns the comment associated with this member (including comment delimiters).intgetFlags()Deprecated.Returns the flags for this member.voidsetComment(String comment) Deprecated.Sets the comment associated with this member.voidsetFlags(int flags) Deprecated.Sets the flags for this member.Methods inherited from interface IDOMNode
addChild, canHaveChildren, clone, getCharacters, getChild, getChildren, getContents, getFirstChild, getJavaElement, getNextNode, getNodeType, getParent, getPreviousNode, insertSibling, isAllowableChild, isSignatureEqual, removeModifier and TypeMethodDescriptionvoidDeprecated.Adds the given un-parented node (document fragment) as the last child of this node.booleanDeprecated.Returns whether this node is allowed to have children.clone()Deprecated.Returns a stand-alone copy of the document fragment represented by this node that is in no way dependent on the document this node is part of.char[]Deprecated.Returns the current contents of this document fragment as a character array.Deprecated.Returns the first named child of this node with the given name.Deprecated.Returns an enumeration of children of this node.Deprecated.Returns the current contents of this document fragment.Deprecated.Returns the first child of this node.getJavaElement(IJavaElement parent) Deprecated.Returns a handle for the Java element associated with this document fragment, based on the parent Java element.Deprecated.Returns the sibling node immediately following this node.intDeprecated.Returns the type of this node.Deprecated.Returns the parent of this node.Deprecated.Returns the sibling node immediately preceding this node.voidinsertSibling(IDOMNode sibling) Deprecated.Inserts the given un-parented node as a sibling of this node, immediately before this node.booleanisAllowableChild(IDOMNode node) Deprecated.Returns whether the given node is an allowable child for this node.booleanisSignatureEqual(IDOMNode node) Deprecated.Returns whether this node's signature is equivalent to the given node's signature.voidremove()Deprecated.Separates this node from its parent and siblings, maintaining any ties that this node has to the underlying document fragment.
-
Method Details
-
addSuperInterface
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). This is a convenience method. For classes, this represents the interfaces that this class implements. For interfaces, this represents the interfaces that this interface extends. The name may or may not be fully qualified.- Parameters:
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".- Throws:
IllegalArgumentException- ifnullis specified
-
getTypeParameters
String[] getTypeParameters()Deprecated.Returns the formal type parameters for this type. Returns an empty array if this method has no formal type parameters.Formal type parameters are as they appear in the source code; for example:
"X extends List<String> & Serializable".- Returns:
- the formal type parameters of this type, in the order declared in the source, an empty array if none
- Since:
- 3.0
-
getName
String getName()Deprecated.TheIDOMTyperefinement of thisIDOMNodemethod 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). -
getSuperclass
String getSuperclass()Deprecated.Returns the name of this type's superclass. 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>".- Returns:
- the superclass name, or
nullif this type represents an interface or if no superclass has been assigned to this class
-
getSuperInterfaces
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. The syntax for interface names is defined by Interfaces in ClassDeclaration (JLS2 8.1). Type names appear as they would in source code. For example:"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.
- Returns:
- the list of interface names
-
isClass
boolean isClass()Deprecated.Returns whether this type is a class.- Returns:
truefor classes, andfalsefor interfaces
-
isEnum
boolean isEnum()Deprecated.Returns whether this type represents an enumeration class ("enum" instead of "class").- Returns:
- true if this type represents an enumeration class, false otherwise
- Since:
- 3.0
-
isAnnotation
boolean isAnnotation()Deprecated.Returns whether this type represents an annotation type ("@interface" instead of "interface").- Returns:
- true if this type represents an annotation type, false otherwise
- Since:
- 3.0
-
setClass
void setClass(boolean b) Deprecated.Sets whether this type is a class or an interface. If this type is a class, and is changed to an interface, this type's superclass becomesnull. When a class becomes an interface or an interface becomes a class, superinterfaces remain (as part of animplementsclause for classes, or anextendsclause for interfaces).- Parameters:
b-truefor classes, andfalsefor interfaces
-
setEnum
void setEnum(boolean b) Deprecated.Sets whether this type represents an enumeration class. If this type is a class and is changed to an enum, this type's superclass becomesnull. If this type is an interface (including an annotation type), and is changed to an enum, this type is also changed to a class.- Parameters:
b-truefor enum classes, andfalseotherwise- Since:
- 3.0
-
setAnnotation
void setAnnotation(boolean b) Deprecated.Sets whether this type represents an annotation type ("@interface" instead of "interface"). If this type is a interface and is changed to an enum, this type's superclass becomesnulland 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.- Parameters:
b-truefor an annotation type, andfalseotherwise- Since:
- 3.0
-
setTypeParameters
Deprecated.Sets the formal type parameters for this type.Formal type parameters are given as they appear in the source code; for example:
"X extends List<String> & Serializable".- Parameters:
typeParameters- the formal type parameters of this type, in the order to appear in the source, an empty array if none- Since:
- 3.0
-
setName
Deprecated.TheIDOMTyperefinement of thisIDOMNodemethod 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).- Specified by:
setNamein interfaceIDOMNode- Parameters:
name- the given name- Throws:
IllegalArgumentException- ifnullis specified
-
setSuperclass
Deprecated.Sets the name of this type's superclass. Has no effect if this type represents an interface. Anullname 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>".- Parameters:
superclassName- the superclass name, ornullif this type should have to no explicitly specified superclass
-
setSuperInterfaces
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. An empty array parameter indicates that no superinterfaces are present. The syntax for interface names is defined by Interfaces in ClassDeclaration (JLS2 8.1). Type names appear as they would in source code. For example:"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.
- Parameters:
interfaceNames- the list of interface names
-