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 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.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​(java.lang.Class<?> clazz)
      • addExtends

        @Deprecated
        default N addExtends​(java.lang.Class<?> clazz)
        Deprecated.
        use addExtendedType
      • addExtends

        @Deprecated
        default N addExtends​(java.lang.String name)
        Deprecated.
        use addExtendedType
      • addExtendedType

        default N addExtendedType​(java.lang.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​(java.lang.String name)
        Add an "extends" to this
        Parameters:
        name - the name of the type to extends from
        Returns:
        this