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 N
addExtendedType(ClassOrInterfaceType extend)
default N
addExtendedType(Class<?> clazz)
Add an "extends" to this and automatically add the importdefault N
addExtendedType(String name)
Add an "extends" to thisdefault N
addExtends(Class<?> clazz)
Deprecated.use addExtendedTypedefault N
addExtends(String name)
Deprecated.use addExtendedTypedefault ClassOrInterfaceType
getExtendedTypes(int i)
default N
setExtendedType(int i, ClassOrInterfaceType extend)
setExtendedTypes(NodeList<ClassOrInterfaceType> extendsList)
void
tryAddImportToParentCompilationUnit(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.Object
unless 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
-