模块 jdk.compiler

接口 SnippetTree

所有父级接口:
DocTree , InlineTagTree

public interface SnippetTree extends InlineTagTree
@snippet 内联标记的树节点。
  {@snippet :
   body
  }

  {@snippet attributes}

  {@snippet attributes :
   body
  }
 
自从:
18
  • 方法详情

    • getAttributes

      List <? extends DocTree > getAttributes()
      返回 @snippet 标签的属性列表。
      返回:
      属性列表
    • getBody

      TextTree  getBody()
      返回 @snippet 标签的主体,如果没有主体则返回 null
      API 注意:
      具有空主体的 SnippetTree 实例不同于没有主体的 SnippetTree 实例。如果标签没有主体,则调用此方法会返回 null 。如果标签的主体为空,则此方法返回一个 TextTree,其 TextTree.getBody() 返回一个空字符串。
      返回:
      标签的主体,如果没有主体则为 null