Package com.puppycrawl.tools.checkstyle
Class TreeWalkerAuditEvent
java.lang.Object
com.puppycrawl.tools.checkstyle.TreeWalkerAuditEvent
Raw
TreeWalker
event for audit.-
Constructor Summary
ConstructorsConstructorDescriptionTreeWalkerAuditEvent
(FileContents fileContents, String fileName, LocalizedMessage localizedMessage, DetailAST rootAst) Creates a newTreeWalkerAuditEvent
instance. -
Method Summary
Modifier and TypeMethodDescriptionint
Gets the column associated with the message.int
Gets the column char index associated with the message.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.Gets the localized message.Return the message associated to the event.Returns id of module.Gets the root element of the AST tree.Gets the name of the source for the message.int
Gets the token type of the message.
-
Constructor Details
-
TreeWalkerAuditEvent
public TreeWalkerAuditEvent(FileContents fileContents, String fileName, LocalizedMessage localizedMessage, DetailAST rootAst) Creates a newTreeWalkerAuditEvent
instance.- Parameters:
fileContents
- contents of the file associated with the eventfileName
- file associated with the eventlocalizedMessage
- the actual messagerootAst
- 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.
-
getLocalizedMessage
Gets the localized message.- Returns:
- the localized message
-
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
Return the message associated to the event.- Returns:
- the event message
-
getColumn
public int getColumn()Gets the column associated with the message.- Returns:
- the column associated with the message
-
getColumnCharIndex
public int getColumnCharIndex()Gets the column char index associated with the message.- Returns:
- the column char index associated with the message
-
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 message.- Returns:
- the name of the source for the message
-
getTokenType
public int getTokenType()Gets the token type of the message.- Returns:
- the token type of the message
-
getRootAst
Gets the root element of the AST tree.- Returns:
- the root element of the AST tree
-