Class AuditEvent
java.lang.Object
java.util.EventObject
com.puppycrawl.tools.checkstyle.api.AuditEvent
- All Implemented Interfaces:
Serializable
Raw event for audit.
I'm not very satisfied about the design of this event since there are optional methods that will return null in most of the case. This will need some work to clean it up especially if we want to introduce a more sequential reporting action rather than a packet reporting. This will allow for example to follow the process quickly in an interface or a servlet (yep, that's cool to run a check via a web interface in a source repository ;-)
- See Also:
-
Field Summary
Fields inherited from class java.util.EventObject
source
-
Constructor Summary
ConstructorsConstructorDescriptionAuditEvent
(Object source) Creates a new instance.AuditEvent
(Object src, String fileName) Creates a newAuditEvent
instance.AuditEvent
(Object src, String fileName, LocalizedMessage localizedMessage) Creates a newAuditEvent
instance. -
Method Summary
Modifier and TypeMethodDescriptionint
Gets the column associated with the message.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 audit event severity level.Gets the name of the source for the message.Methods inherited from class java.util.EventObject
getSource, toString
-
Constructor Details
-
AuditEvent
Creates a new instance.- Parameters:
source
- the object that created the event
-
AuditEvent
Creates a newAuditEvent
instance.- Parameters:
src
- source of the eventfileName
- file associated with the event
-
AuditEvent
Creates a newAuditEvent
instance.- Parameters:
src
- source of the eventfileName
- file associated with the eventlocalizedMessage
- the actual message
-
-
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.
-
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
-
getSeverityLevel
Gets the audit event severity level.- Returns:
- the audit event severity level
-
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
-
getLocalizedMessage
Gets the localized message.- Returns:
- the localized message
-