public abstract class AbstractViolationReporter extends AutomaticBean
violations that are created by the module.AutomaticBean.OutputStreamOptions| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
id
The identifier of the reporter.
|
private SeverityLevel |
severityLevel
The severity level of any violations found.
|
| 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 java.util.Map<java.lang.String,java.lang.String> |
getCustomMessages()
Returns an unmodifiable map instance containing the custom messages
for this configuration.
|
java.lang.String |
getId()
Returns the identifier of the reporter.
|
protected java.lang.String |
getMessageBundle()
Returns the message bundle name resource bundle that contains the messages
used by this module.
|
private static java.lang.String |
getMessageBundle(java.lang.String className)
For unit tests, especially with a class with no package name.
|
java.lang.String |
getSeverity()
Get the severity level's name.
|
SeverityLevel |
getSeverityLevel()
Returns the severity level of the violations generated by this module.
|
abstract void |
log(int line,
int col,
java.lang.String key,
java.lang.Object... args)
Log a message that has column information.
|
abstract void |
log(int line,
java.lang.String key,
java.lang.Object... args)
Log a message that has no column information.
|
void |
setId(java.lang.String id)
Sets the identifier of the reporter.
|
void |
setSeverity(java.lang.String severity)
Sets the severity level.
|
configure, contextualize, getConfiguration, setupChildprivate SeverityLevel severityLevel
private java.lang.String id
public AbstractViolationReporter()
public final SeverityLevel getSeverityLevel()
SeverityLevel,
Violation.getSeverityLevel()public final void setSeverity(java.lang.String severity)
SeverityLevel class.severity - The new severity levelSeverityLevelpublic final java.lang.String getSeverity()
public final java.lang.String getId()
public final void setId(java.lang.String id)
id - the idprotected java.util.Map<java.lang.String,java.lang.String> getCustomMessages()
protected java.lang.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.
private static java.lang.String getMessageBundle(java.lang.String className)
className - class name of the module.protected void finishLocalSetup() throws CheckstyleException
AutomaticBeanThe default implementation does nothing.
finishLocalSetup in class AutomaticBeanCheckstyleException - if there is a configuration error.public abstract void log(int line, java.lang.String key, java.lang.Object... args)
line - the line number where the audit event was foundkey - the message that describes the audit eventargs - the details of the messageMessageFormatpublic abstract void log(int line, int col, java.lang.String key, java.lang.Object... args)
line - the line number where the audit event was foundcol - the column number where the audit event was foundkey - the message that describes the audit eventargs - the details of the messageMessageFormatCopyright © 2001-2022. All Rights Reserved.