Interface NodeWithExtends<N extends Node>
- All Known Implementing Classes:
ClassOrInterfaceDeclaration
public interface NodeWithExtends<N extends Node>
A node that explicitly extends other types, using the
extends keyword.-
Method Summary
Modifier and TypeMethodDescriptiondefault NaddExtendedType(ClassOrInterfaceType extend)default NaddExtendedType(Class<?> clazz)Add an "extends" to this and automatically add the importdefault NaddExtendedType(String name)Add an "extends" to thisdefault NaddExtends(Class<?> clazz)Deprecated.use addExtendedTypedefault NaddExtends(String name)Deprecated.use addExtendedTypedefault ClassOrInterfaceTypegetExtendedTypes(int i)default NsetExtendedType(int i, ClassOrInterfaceType extend)setExtendedTypes(NodeList<ClassOrInterfaceType> extendsList)voidtryAddImportToParentCompilationUnit(Class<?> clazz)
-
Method Details
-
getExtendedTypes
NodeList<ClassOrInterfaceType> getExtendedTypes()- Returns:
- All extended types that have been explicitly added (thus exist within the AST).
Note that this can contain more than one item if this is an interface.
Note that this will not include
java.lang.Objectunless it is explicitly added (e.g.class X extends Object {}) If you want the implicitly extended types, you will need a resolved reference.
-
tryAddImportToParentCompilationUnit
-
getExtendedTypes
-
setExtendedTypes
-
setExtendedType
-
addExtendedType
-
addExtends
Deprecated.use addExtendedType -
addExtends
Deprecated.use addExtendedType -
addExtendedType
Add an "extends" to this and automatically add the import- Parameters:
clazz- the class to extend from- Returns:
- this
-
addExtendedType
Add an "extends" to this- Parameters:
name- the name of the type to extends from- Returns:
- this
-