Class TreeWalkerAuditEvent

java.lang.Object
com.puppycrawl.tools.checkstyle.TreeWalkerAuditEvent

public class TreeWalkerAuditEvent extends Object
Raw TreeWalker event for audit.
  • Field Details

  • Constructor Details

    • TreeWalkerAuditEvent

      public TreeWalkerAuditEvent(FileContents fileContents, String fileName, Violation violation, DetailAST rootAst)
      Creates a new TreeWalkerAuditEvent instance.
      Parameters:
      fileContents - contents of the file associated with the event
      fileName - file associated with the event
      violation - the actual violation
      rootAst - root AST element DetailAST of the file
  • Method Details

    • getFileName

      public String getFileName()
      Returns name of file being audited.
      Returns:
      the file name currently being audited or null if there is no relation to a file.
    • getFileContents

      Returns contents of the file.
      Returns:
      contents of the file.
    • getViolation

      Gets the violation.
      Returns:
      the violation
    • getLine

      public int getLine()
      Return the line number on the source file where the event occurred. This may be 0 if there is no relation to a file content.
      Returns:
      an integer representing the line number in the file source code.
    • getMessage

      public String getMessage()
      Return the violation associated to the event.
      Returns:
      the violation message
    • getColumn

      public int getColumn()
      Gets the column associated with the violation.
      Returns:
      the column associated with the violation
    • getColumnCharIndex

      public int getColumnCharIndex()
      Gets the column char index associated with the violation.
      Returns:
      the column char index associated with the violation
    • getModuleId

      public String getModuleId()
      Returns id of module.
      Returns:
      the identifier of the module that generated the event. Can return null.
    • getSourceName

      Gets the name of the source for the violation.
      Returns:
      the name of the source for the violation
    • getTokenType

      public int getTokenType()
      Gets the token type of the violation.
      Returns:
      the token type of the violation
    • getRootAst

      Gets the root element of the AST tree.
      Returns:
      the root element of the AST tree