Class ErrorProneTokens

java.lang.Object
com.google.errorprone.util.ErrorProneTokens

public class ErrorProneTokens
extends Object
A utility for tokenizing and preserving comments.
  • Constructor Summary

    Constructors
    Constructor Description
    ErrorProneTokens​(String source, int offset, com.sun.tools.javac.util.Context context)  
    ErrorProneTokens​(String source, com.sun.tools.javac.util.Context context)  
  • Method Summary

    Modifier and Type Method Description
    com.sun.tools.javac.util.Position.LineMap getLineMap()  
    com.google.common.collect.ImmutableList<ErrorProneToken> getTokens()  
    static com.google.common.collect.ImmutableList<ErrorProneToken> getTokens​(String source, int offset, com.sun.tools.javac.util.Context context)
    Returns the tokens for the given source text, including comments, indicating the offset of the source within the overall file.
    static com.google.common.collect.ImmutableList<ErrorProneToken> getTokens​(String source, com.sun.tools.javac.util.Context context)
    Returns the tokens for the given source text, including comments.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ErrorProneTokens

      public ErrorProneTokens​(String source, com.sun.tools.javac.util.Context context)
    • ErrorProneTokens

      public ErrorProneTokens​(String source, int offset, com.sun.tools.javac.util.Context context)
  • Method Details

    • getLineMap

      public com.sun.tools.javac.util.Position.LineMap getLineMap()
    • getTokens

      public com.google.common.collect.ImmutableList<ErrorProneToken> getTokens()
    • getTokens

      public static com.google.common.collect.ImmutableList<ErrorProneToken> getTokens​(String source, com.sun.tools.javac.util.Context context)
      Returns the tokens for the given source text, including comments.
    • getTokens

      public static com.google.common.collect.ImmutableList<ErrorProneToken> getTokens​(String source, int offset, com.sun.tools.javac.util.Context context)
      Returns the tokens for the given source text, including comments, indicating the offset of the source within the overall file.