Package com.puppycrawl.tools.checkstyle
Class TreeWalkerAuditEvent
java.lang.Object
com.puppycrawl.tools.checkstyle.TreeWalkerAuditEvent
Raw
TreeWalker event for audit.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final FileContentsThe file contents.private final StringFilename event associated with.private final DetailASTRoot ast element.private final ViolationViolation associated with the event. -
Constructor Summary
ConstructorsConstructorDescriptionTreeWalkerAuditEvent(FileContents fileContents, String fileName, Violation violation, DetailAST rootAst) Creates a newTreeWalkerAuditEventinstance. -
Method Summary
Modifier and TypeMethodDescriptionintGets the column associated with the violation.intGets the column char index associated with the violation.Returns contents of the file.Returns name of file being audited.intgetLine()Return the line number on the source file where the event occurred.Return the violation associated to the event.Returns id of module.Gets the root element of the AST tree.Gets the name of the source for the violation.intGets the token type of the violation.Gets the violation.
-
Field Details
-
fileName
Filename event associated with. -
fileContents
The file contents. -
violation
Violation associated with the event. -
rootAst
Root ast element.
-
-
Constructor Details
-
TreeWalkerAuditEvent
public TreeWalkerAuditEvent(FileContents fileContents, String fileName, Violation violation, DetailAST rootAst) Creates a newTreeWalkerAuditEventinstance.- Parameters:
fileContents- contents of the file associated with the eventfileName- file associated with the eventviolation- the actual violationrootAst- root AST elementDetailASTof the file
-
-
Method Details
-
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
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
Return the violation associated to the event.- Returns:
- the violation message
-
getColumn
Gets the column associated with the violation.- Returns:
- the column associated with the violation
-
getColumnCharIndex
Gets the column char index associated with the violation.- Returns:
- the column char index associated with the violation
-
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
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
-