|
|||||||||||
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 com.puppycrawl.tools.checkstyle.api.AbstractFileSetCheck
Provides common functionality for many FileSetChecks.
Constructor Summary | |
AbstractFileSetCheck()
|
Method Summary | |
void |
destroy()
Cleans up the object. |
protected java.io.File[] |
filter(java.io.File[] aFiles)
Determines the set of files this FileSetCheck is interested in. |
protected void |
fireErrors(java.lang.String aFileName)
Notify all listeners about the errors in a file. |
java.lang.String |
getCharset()
|
protected LocalizedMessages |
getMessageCollector()
Returns the collector for violation messages. |
protected MessageDispatcher |
getMessageDispatcher()
A message dispatcher is used to fire violation messages to interested audit listeners. |
protected void |
log(int aLineNo,
int aColNo,
java.lang.String aKey,
java.lang.Object[] aArgs)
Adds a violation message to the message collector . |
protected void |
log(int aLine,
java.lang.String aKey,
java.lang.Object[] aArgs)
Adds a violation message to the message collector . |
void |
setCharset(java.lang.String aCharset)
Sets a named charset. |
void |
setFileExtensions(java.lang.String[] aExtensions)
Sets the file extensions that identify the files that pass the filter of this FileSetCheck. |
void |
setMessageDispatcher(MessageDispatcher aDispatcher)
Sets the MessageDispatcher that is used to dispatch error messages to AuditListeners during processing. |
Methods inherited from class com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter |
getMessageBundle, getSeverity, getSeverityLevel, log, log, log, log, log, log, log, log, log, setSeverity |
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 |
Methods inherited from interface com.puppycrawl.tools.checkstyle.api.FileSetCheck |
process |
Methods inherited from interface com.puppycrawl.tools.checkstyle.api.Configurable |
configure |
Methods inherited from interface com.puppycrawl.tools.checkstyle.api.Contextualizable |
contextualize |
Constructor Detail |
public AbstractFileSetCheck()
Method Detail |
public void destroy()
FileSetCheck
destroy
in interface FileSetCheck
FileSetCheck
public java.lang.String getCharset()
public void setCharset(java.lang.String aCharset) throws java.io.UnsupportedEncodingException
aCharset
- the name of a charset
java.io.UnsupportedEncodingException
- if aCharset is unsupported.public final void setMessageDispatcher(MessageDispatcher aDispatcher)
FileSetCheck
setMessageDispatcher
in interface FileSetCheck
aDispatcher
- the dispatcherFileSetCheck
protected final MessageDispatcher getMessageDispatcher()
protected final java.io.File[] filter(java.io.File[] aFiles)
This method can be used in the implementation of process()
to filter it's argument list for interesting files.
aFiles
- the candidates for processing
FileSetCheck.process(java.io.File[])
public final void setFileExtensions(java.lang.String[] aExtensions)
aExtensions
- the set of file extensions. A missing
initial '.' character of an extension is automatically added.protected final LocalizedMessages getMessageCollector()
protected final void log(int aLine, java.lang.String aKey, java.lang.Object[] aArgs)
message collector
.
log
in class AbstractViolationReporter
aLine
- the line number where the error was foundaKey
- the message that describes the erroraArgs
- the details of the messageAbstractViolationReporter.log(int, String, Object[])
protected final void log(int aLineNo, int aColNo, java.lang.String aKey, java.lang.Object[] aArgs)
message collector
.
log
in class AbstractViolationReporter
aLineNo
- the line number where the error was foundaColNo
- the column number where the error was foundaKey
- the message that describes the erroraArgs
- the details of the messageAbstractViolationReporter.log(int, int, String, Object[])
protected final void fireErrors(java.lang.String aFileName)
MessageDispatcher.fireErrors()
with
all logged errors and than clears errors' list.
aFileName
- the audited file
|
Back to the Checkstyle Home Page | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |