public abstract class AbstractViolationReporter extends AutomaticBean
localized messages
that are created by the module.AutomaticBean.OutputStreamOptions
Constructor and Description |
---|
AbstractViolationReporter() |
Modifier and Type | Method and Description |
---|---|
protected void |
finishLocalSetup()
Provides a hook to finish the part of this component's setup that
was not handled by the bean introspection.
|
protected Map<String,String> |
getCustomMessages()
Returns an unmodifiable map instance containing the custom messages
for this configuration.
|
String |
getId()
Returns the identifier of the reporter.
|
protected String |
getMessageBundle()
Returns the message bundle name resource bundle 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.
|
abstract void |
log(int line,
int col,
String key,
Object... args)
Log a message that has column information.
|
abstract void |
log(int line,
String key,
Object... args)
Log a message that has no column information.
|
void |
setId(String id)
Sets the identifier of the reporter.
|
void |
setSeverity(String severity)
Sets the severity level.
|
configure, contextualize, getConfiguration, setupChild
public AbstractViolationReporter()
public final SeverityLevel getSeverityLevel()
SeverityLevel
,
LocalizedMessage.getSeverityLevel()
public final void setSeverity(String severity)
SeverityLevel
class.severity
- The new severity levelSeverityLevel
public final String getSeverity()
public final String getId()
public final void setId(String id)
id
- the idprotected Map<String,String> getCustomMessages()
protected 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 void finishLocalSetup() throws CheckstyleException
AutomaticBean
The default implementation does nothing.
finishLocalSetup
in class AutomaticBean
CheckstyleException
- if there is a configuration error.public abstract void log(int line, String key, Object... args)
line
- the line number where the error was foundkey
- the message that describes the errorargs
- the details of the messageMessageFormat
public abstract void log(int line, int col, String key, Object... args)
line
- the line number where the error was foundcol
- the column number where the error was foundkey
- the message that describes the errorargs
- the details of the messageMessageFormat
Copyright © 2001–2018. All rights reserved.