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 FileContents
The file contents.private final String
Filename event associated with.private final DetailAST
Root ast element.private final Violation
Violation associated with the event. -
Constructor Summary
ConstructorsConstructorDescriptionTreeWalkerAuditEvent
(FileContents fileContents, String fileName, Violation violation, DetailAST rootAst) Creates a newTreeWalkerAuditEvent
instance. -
Method Summary
Modifier and TypeMethodDescriptionint
Gets the column associated with the violation.int
Gets the column char index associated with the violation.Returns contents of the file.Returns name of file being audited.int
getLine()
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.int
Gets 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 newTreeWalkerAuditEvent
instance.- Parameters:
fileContents
- contents of the file associated with the eventfileName
- file associated with the eventviolation
- the actual violationrootAst
- root AST elementDetailAST
of 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
-