public abstract class AbstractViolationReporter extends AutomaticBean
localized messages
that are created by the module.修飾子とタイプ | フィールドと説明 |
---|---|
static int |
DEFAULT_ERROR_SCORE
default score for error.
|
static int |
DEFAULT_INFO_SCORE
default score for info.
|
static int |
DEFAULT_WARNING_SCORE
default score for warning.
|
protected Scoring |
mScoring
represents how to calculate score.
|
protected int |
mViolationSize
represents the size of violation.
|
コンストラクタと説明 |
---|
AbstractViolationReporter() |
修飾子とタイプ | メソッドと説明 |
---|---|
protected int |
calculateScore()
calculate score. you can override this if you need customized scoring logic.
|
protected Map<String,String> |
getCustomMessages()
Returns an unmodifiable map instance containing the custom messages
for this configuration.
|
int |
getErrorScore() |
String |
getId()
Returns the identifier of the reporter.
|
int |
getInfoScore() |
protected String |
getMessageBundle()
Returns the message bundle name resourcebundle that contains the messages
used by this module.
|
int |
getScore() |
String |
getScoring() |
String |
getSeverity()
Get the severity level's name.
|
SeverityLevel |
getSeverityLevel()
Returns the severity level of the messages generated by this module.
|
int |
getWarningScore() |
protected void |
log(DetailAST aAST,
String aKey,
Object... aArgs)
Helper method to log a LocalizedMessage.
|
abstract void |
log(int aLine,
int aCol,
String aKey,
Object... aArgs)
Log a message that has column information.
|
abstract void |
log(int aLine,
String aKey,
Object... aArgs)
Log a message that has no column information.
|
void |
setErrorScore(int mErrorScore) |
void |
setId(String aId)
Sets the identifier of the reporter.
|
void |
setInfoScore(int mInfoScore) |
void |
setScore(int mScore) |
void |
setScoring(String mScoring) |
void |
setSeverity(String aSeverity)
Sets the severity level.
|
void |
setWarningScore(int mWarningScore) |
configure, contextualize, finishLocalSetup, getConfiguration, setupChild
public static final int DEFAULT_INFO_SCORE
public static final int DEFAULT_WARNING_SCORE
public static final int DEFAULT_ERROR_SCORE
protected int mViolationSize
protected Scoring mScoring
public final SeverityLevel getSeverityLevel()
SeverityLevel
,
LocalizedMessage.getSeverityLevel()
public final void setSeverity(String aSeverity)
SeverityLevel
class.aSeverity
- The new severity levelSeverityLevel
public final String getSeverity()
public final String getId()
public final void setId(String aId)
aId
- the idprotected final void log(DetailAST aAST, String aKey, Object... aArgs)
aAST
- a node to get line and column numbers associated
with the messageaKey
- key to locale message formataArgs
- arguments to formatprotected 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 Map<String,String> getCustomMessages()
public 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
public 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
protected int calculateScore()
public int getInfoScore()
public void setInfoScore(int mInfoScore)
public int getWarningScore()
public void setWarningScore(int mWarningScore)
public int getErrorScore()
public void setErrorScore(int mErrorScore)
public int getScore()
public void setScore(int mScore)
public String getScoring()
public void setScoring(String mScoring)
Copyright © 2001-2013. All Rights Reserved.