public abstract class AbstractFileSetCheck extends AbstractViolationReporter implements FileSetCheck
Constructor and Description |
---|
AbstractFileSetCheck() |
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Cleans up the object.
|
protected File[] |
filter(File[] aFiles)
Determines the set of files this FileSetCheck is interested in.
|
protected void |
fireErrors(String aFileName)
Notify all listeners about the errors in a file.
|
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,
String aKey,
Object[] aArgs)
Adds a violation message to the
message collector . |
protected void |
log(int aLine,
String aKey,
Object[] aArgs)
Adds a violation message to the
message collector . |
void |
setCharset(String aCharset)
Sets a named charset.
|
void |
setFileExtensions(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.
|
getId, getMessageBundle, getSeverity, getSeverityLevel, log, log, log, log, log, log, log, log, log, setId, setSeverity
configure, contextualize, finishLocalSetup, getConfiguration, setupChild
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
process
configure
contextualize
public void destroy()
FileSetCheck
destroy
in interface FileSetCheck
FileSetCheck
public String getCharset()
public void setCharset(String aCharset) throws UnsupportedEncodingException
aCharset
- the name of a charsetUnsupportedEncodingException
- if aCharset is unsupported.public final void setMessageDispatcher(MessageDispatcher aDispatcher)
setMessageDispatcher
in interface FileSetCheck
aDispatcher
- the dispatcherprotected final MessageDispatcher getMessageDispatcher()
protected final File[] filter(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 processingFileSetCheck.process(java.io.File[])
public final void setFileExtensions(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, String aKey, Object[] aArgs)
message collector
.
Log a message that has no column information.log
in class AbstractViolationReporter
aLine
- the line number where the error was foundaKey
- the message that describes the erroraArgs
- the details of the messageMessageFormat
protected final void log(int aLineNo, int aColNo, String aKey, Object[] aArgs)
message collector
.
Log a message that has column information.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 messageMessageFormat
protected final void fireErrors(String aFileName)
MessageDispatcher.fireErrors()
with
all logged errors and than clears errors' list.aFileName
- the audited file