Class JavacTokens.CommentWithTextAndPosition

java.lang.Object
com.google.googlejavaformat.java.JavacTokens.CommentWithTextAndPosition
Enclosing class:
JavacTokens

static class JavacTokens.CommentWithTextAndPosition extends Object
A Tokens.Comment that saves its text and start position.
  • Field Details

    • pos

      private final int pos
    • endPos

      private final int endPos
    • text

      private final String text
  • Constructor Details

    • CommentWithTextAndPosition

      public CommentWithTextAndPosition(int pos, int endPos, String text)
  • Method Details

    • getSourcePos

      public int getSourcePos(int index)
      Returns the source position of the character at index index in the comment text.

      The handling of javadoc comments in javac has more logic to skip over leading whitespace and '*' characters when indexing into doc comments, but we don't need any of that.

    • getText

      public String getText()
    • toString

      public String toString()
      Overrides:
      toString in class Object