|
|||||||||||
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.Checker
This class provides the functionality to check a set of files.
Constructor Summary | |
Checker()
Creates a new Checker instance. |
Method Summary | |
void |
addFileSetCheck(FileSetCheck aFileSetCheck)
Adds a FileSetCheck to the list of FileSetChecks that is executed in process(). |
void |
addFilter(Filter aFilter)
Adds a filter to the end of the audit event filter chain. |
void |
addListener(AuditListener aListener)
Add the listener that will be used to receive events from the audit. |
void |
destroy()
Cleans up the object. |
void |
finishLocalSetup()
Provides a hook to finish the part of this compoent's setup that was not handled by the bean introspection. |
protected void |
fireAuditFinished()
notify all listeners about the audit end |
protected void |
fireAuditStarted()
notify all listeners about the audit start |
void |
fireErrors(java.lang.String aFileName,
LocalizedMessage[] aErrors)
notify all listeners about the errors in a file. |
void |
fireFileFinished(java.lang.String aFileName)
Notify all listeners about the end of a file audit. |
void |
fireFileStarted(java.lang.String aFileName)
Notify all listeners about the beginning of a file audit. |
java.lang.String |
normalize(java.lang.String aPath)
"normalize" the given absolute path. |
int |
process(java.io.File[] aFiles)
Processes a set of files with all FileSetChecks. |
void |
removeFilter(Filter aFilter)
Removes filter. |
void |
removeListener(AuditListener aListener)
Removes a given listener. |
void |
setBasedir(java.lang.String aBasedir)
|
void |
setClassloader(java.lang.ClassLoader aLoader)
Sets the classloader that is used to contextualize filesetchecks. |
void |
setLocaleCountry(java.lang.String aLocaleCountry)
|
void |
setLocaleLanguage(java.lang.String aLocaleLanguage)
|
void |
setModuleFactory(ModuleFactory aModuleFactory)
Sets the factory for creating submodules. |
void |
setSeverity(java.lang.String aSeverity)
Sets the severity level. |
protected void |
setupChild(Configuration aChildConf)
Instantiates, configures and registers a child AbstractFilter or FileSetCheck that is specified in the provided configuration. |
Methods inherited from class com.puppycrawl.tools.checkstyle.api.AutomaticBean |
configure, contextualize, getConfiguration |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Checker() throws CheckstyleException
Checker
instance.
The instance needs to be contextualized and configured.
CheckstyleException
- if an error occursMethod Detail |
public void finishLocalSetup() throws CheckstyleException
AutomaticBean
The default implementation does nothing.
finishLocalSetup
in class AutomaticBean
CheckstyleException
- if there is a configuration error.AutomaticBean
protected void setupChild(Configuration aChildConf) throws CheckstyleException
setupChild
in class AutomaticBean
aChildConf
- a child of this component's Configuration
CheckstyleException
- if there is a configuration error.AutomaticBean
public void addFileSetCheck(FileSetCheck aFileSetCheck)
aFileSetCheck
- the additional FileSetCheckpublic void addFilter(Filter aFilter)
aFilter
- the additional filterpublic void removeFilter(Filter aFilter)
aFilter
- filter to remove.public void destroy()
public void addListener(AuditListener aListener)
aListener
- the nosy thingpublic void removeListener(AuditListener aListener)
aListener
- a listener to removepublic int process(java.io.File[] aFiles)
aFiles
- the list of files to be audited.
destroy()
public void setBasedir(java.lang.String aBasedir)
aBasedir
- the base directory to strip off in filenamespublic java.lang.String normalize(java.lang.String aPath)
This includes:
aPath
- a path for "normalizing"
java.lang.NullPointerException
- if the file path is
equal to null.protected void fireAuditStarted()
protected void fireAuditFinished()
public void fireFileStarted(java.lang.String aFileName)
fireFileStarted
in interface MessageDispatcher
aFileName
- the file to be auditedpublic void fireFileFinished(java.lang.String aFileName)
fireFileFinished
in interface MessageDispatcher
aFileName
- the audited filepublic void fireErrors(java.lang.String aFileName, LocalizedMessage[] aErrors)
fireErrors
in interface MessageDispatcher
aFileName
- the audited fileaErrors
- the audit errors from the filepublic void setModuleFactory(ModuleFactory aModuleFactory)
aModuleFactory
- the factory for creating FileSetCheckspublic void setLocaleCountry(java.lang.String aLocaleCountry)
aLocaleCountry
- the country to report messagespublic void setLocaleLanguage(java.lang.String aLocaleLanguage)
aLocaleLanguage
- the language to report messagespublic final void setSeverity(java.lang.String aSeverity)
SeverityLevel
class.
aSeverity
- The new severity levelSeverityLevel
public final void setClassloader(java.lang.ClassLoader aLoader)
aLoader
- the new classloader
|
Back to the Checkstyle Home Page | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |