Interface NodeWithExtends<N extends Node>
-
- All Known Implementing Classes:
ClassOrInterfaceDeclaration
public interface NodeWithExtends<N extends Node>A node that explicitly extends other types, using theextendskeyword.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description default 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 addExtendedTypeNodeList<ClassOrInterfaceType>getExtendedTypes()default ClassOrInterfaceTypegetExtendedTypes(int i)default NsetExtendedType(int i, ClassOrInterfaceType extend)NsetExtendedTypes(NodeList<ClassOrInterfaceType> extendsList)voidtryAddImportToParentCompilationUnit(Class<?> clazz)
-
-
-
Method Detail
-
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
void tryAddImportToParentCompilationUnit(Class<?> clazz)
-
getExtendedTypes
default ClassOrInterfaceType getExtendedTypes(int i)
-
setExtendedTypes
N setExtendedTypes(NodeList<ClassOrInterfaceType> extendsList)
-
setExtendedType
default N setExtendedType(int i, ClassOrInterfaceType extend)
-
addExtendedType
default N addExtendedType(ClassOrInterfaceType extend)
-
addExtends
@Deprecated default N addExtends(Class<?> clazz)
Deprecated.use addExtendedType
-
addExtends
@Deprecated default N addExtends(String name)
Deprecated.use addExtendedType
-
addExtendedType
default N addExtendedType(Class<?> clazz)
Add an "extends" to this and automatically add the import- Parameters:
clazz- the class to extend from- Returns:
- this
-
-