Interface SyntaxToken

All Superinterfaces:
Tree
All Known Implementing Classes:
InternalSyntaxToken, ModifierKeywordTreeImpl

@Beta public interface SyntaxToken extends Tree
Represents a token in the syntax tree.
Since:
plugin 2.4
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.sonar.plugins.java.api.tree.Tree

    Tree.Kind
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Deprecated, for removal: This API element is subject to removal in a future version.
    for removal, since = 7.3, "column()" can be replaced by range().start().columnOffset() and "column() + 1" can be replaced by range().start().column()
    int
    Deprecated, for removal: This API element is subject to removal in a future version.
    for removal, since = 7.3, use "range().start().line()".
     
     
     

    Methods inherited from interface org.sonar.plugins.java.api.tree.Tree

    accept, firstToken, is, kind, lastToken, parent
  • Method Details

    • text

      String text()
    • trivias

      List<SyntaxTrivia> trivias()
    • line

      @Deprecated(since="7.3", forRemoval=true) int line()
      Deprecated, for removal: This API element is subject to removal in a future version.
      for removal, since = 7.3, use "range().start().line()". A token is not anymore on a single line since the text block feature has been introduced in the java language.
      Returns:
      line number starting at 1
    • column

      @Deprecated(since="7.3", forRemoval=true) int column()
      Deprecated, for removal: This API element is subject to removal in a future version.
      for removal, since = 7.3, "column()" can be replaced by range().start().columnOffset() and "column() + 1" can be replaced by range().start().column()
      Warning: this is not the column number starting at 1 but the column offset starting at 0
      Returns:
      column offset starting at 0
    • range

      Range range()