|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.puppycrawl.tools.checkstyle.api.AutomaticBean com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter
public abstract class AbstractViolationReporter
Serves as an abstract base class for all modules that report inspection
findings. Such modules have a Severity level which is used for the
localized messages
that are created by the module.
Constructor Summary | |
---|---|
AbstractViolationReporter()
|
Method Summary | |
---|---|
protected String |
getMessageBundle()
Returns the message bundle name resourcebundle that contains the messages used by this module. |
String |
getSeverity()
Get the severity level's name. |
SeverityLevel |
getSeverityLevel()
Returns the severity level of the messages generated by this module. |
protected void |
log(DetailAST aAST,
String aKey)
Helper method to log a LocalizedMessage. |
protected void |
log(DetailAST aAST,
String aKey,
Object aArg0)
Helper method to log a LocalizedMessage. |
protected void |
log(DetailAST aAST,
String aKey,
Object aArg0,
Object aArg1)
Helper method to log a LocalizedMessage. |
protected void |
log(int aLineNo,
int aColNo,
String aKey)
Helper method to log a LocalizedMessage. |
protected void |
log(int aLineNo,
int aColNo,
String aKey,
Object aArg0)
Helper method to log a LocalizedMessage. |
protected abstract void |
log(int aLine,
int aCol,
String aKey,
Object[] aArgs)
Log a message that has column information. |
protected void |
log(int aLineNo,
int aColNo,
String aKey,
Object aArg0,
Object aArg1)
Helper method to log a LocalizedMessage. |
protected void |
log(int aLine,
String aKey)
Log a message. |
protected void |
log(int aLineNo,
String aKey,
Object aArg0)
Helper method to log a LocalizedMessage. |
protected abstract void |
log(int aLine,
String aKey,
Object[] aArgs)
Log a message that has no column information. |
protected void |
log(int aLineNo,
String aKey,
Object aArg0,
Object aArg1)
Helper method to log a LocalizedMessage. |
void |
setSeverity(String aSeverity)
Sets the severity level. |
Methods inherited from class com.puppycrawl.tools.checkstyle.api.AutomaticBean |
---|
configure, contextualize, finishLocalSetup, getConfiguration, setupChild |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractViolationReporter()
Method Detail |
---|
public final SeverityLevel getSeverityLevel()
SeverityLevel
,
LocalizedMessage.getSeverityLevel()
public final void setSeverity(String aSeverity)
SeverityLevel
class.
aSeverity
- The new severity levelSeverityLevel
public final String getSeverity()
protected final void log(int aLine, String aKey)
aLine
- the line number where the error was foundaKey
- the message that describes the errorprotected final void log(int aLineNo, String aKey, Object aArg0)
aLineNo
- line number to associate with the messageaKey
- key to locale message formataArg0
- first argumentprotected final void log(int aLineNo, String aKey, Object aArg0, Object aArg1)
aLineNo
- line number to associate with the messageaKey
- key to locale message formataArg0
- first argumentaArg1
- second argumentprotected final void log(int aLineNo, int aColNo, String aKey)
aLineNo
- line number to associate with the messageaColNo
- column number to associate with the messageaKey
- key to locale message formatprotected final void log(DetailAST aAST, String aKey)
aAST
- a node to get line and column numbers associated
with the messageaKey
- key to locale message formatprotected final void log(int aLineNo, int aColNo, String aKey, Object aArg0)
aLineNo
- line number to associate with the messageaColNo
- column number to associate with the messageaKey
- key to locale message formataArg0
- an Object
valueprotected final void log(DetailAST aAST, String aKey, Object aArg0)
aAST
- a node to get line and column numbers associated
with the messageaKey
- key to locale message formataArg0
- an Object
valueprotected final void log(int aLineNo, int aColNo, String aKey, Object aArg0, Object aArg1)
aLineNo
- line number to associate with the messageaColNo
- column number to associate with the messageaKey
- key to locale message formataArg0
- an Object
valueaArg1
- an Object
valueprotected final void log(DetailAST aAST, String aKey, Object aArg0, Object aArg1)
aAST
- a node to get line and column numbers associated
with the messageaKey
- key to locale message formataArg0
- an Object
valueaArg1
- an Object
valueprotected String getMessageBundle()
The default implementation expects the resource files to be named messages.properties, messages_de.properties, etc. The file must be placed in the same package as the module implementation.
Example: If you write com/foo/MyCoolCheck, create resource files com/foo/messages.properties, com/foo/messages_de.properties, etc.
protected abstract void log(int aLine, String aKey, Object[] aArgs)
aLine
- the line number where the error was foundaKey
- the message that describes the erroraArgs
- the details of the messageMessageFormat
protected abstract void log(int aLine, int aCol, String aKey, Object[] aArgs)
aLine
- the line number where the error was foundaCol
- the column number where the error was foundaKey
- the message that describes the erroraArgs
- the details of the messageMessageFormat
|
Back to the Checkstyle Home Page | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |