com.puppycrawl.tools.checkstyle
Class AuditEvent
java.lang.Object
|
+--java.util.EventObject
|
+--com.puppycrawl.tools.checkstyle.AuditEvent
- All Implemented Interfaces:
- java.io.Serializable
- public class AuditEvent
- extends java.util.EventObject
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 error
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 ;-)
- Author:
- Stephane Bailliez
- See Also:
AuditListener
, Serialized Form
Fields inherited from class java.util.EventObject |
source |
Constructor Summary |
AuditEvent(java.lang.Object aSource)
Creates a new instance. |
AuditEvent(java.lang.Object aSrc,
java.lang.String aFileName)
Creates a new AuditEvent instance. |
AuditEvent(java.lang.Object aSrc,
java.lang.String aFileName,
int aLine,
int aColumn,
java.lang.String aMessage)
Creates a new AuditEvent instance. |
Method Summary |
int |
getColumn()
|
java.lang.String |
getFileName()
|
int |
getLine()
return the line number on the source file where the event occurred. |
java.lang.String |
getMessage()
return the message associated to the event. |
Methods inherited from class java.util.EventObject |
getSource, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
AuditEvent
public AuditEvent(java.lang.Object aSource)
- Creates a new instance.
- Parameters:
aSource
- the object that created the event
AuditEvent
public AuditEvent(java.lang.Object aSrc,
java.lang.String aFileName)
- Creates a new
AuditEvent
instance.
- Parameters:
aSrc
- source of the eventaFileName
- file associated with the event
AuditEvent
public AuditEvent(java.lang.Object aSrc,
java.lang.String aFileName,
int aLine,
int aColumn,
java.lang.String aMessage)
- Creates a new
AuditEvent
instance.
- Parameters:
aSrc
- source of the eventaFileName
- file associated with the eventaLine
- line number of messageaColumn
- column number of messageaMessage
- the actual message
getFileName
public java.lang.String getFileName()
- 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
public java.lang.String getMessage()
- return the message associated to the event.
- Returns:
- the event message
getColumn
public int getColumn()
- Returns:
- the column associated with the message