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 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

      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
    • addExtendedType

      default N addExtendedType(String name)
      Add an "extends" to this
      Parameters:
      name - the name of the type to extends from
      Returns:
      this