|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.puppycrawl.tools.checkstyle.api.AutomaticBean
com.puppycrawl.tools.checkstyle.Checker
public class 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 component'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(String aFileName,
TreeSet<LocalizedMessage> aErrors)
notify all listeners about the errors in a file. |
void |
fireFileFinished(String aFileName)
Notify all listeners about the end of a file audit. |
void |
fireFileStarted(String aFileName)
Notify all listeners about the beginning of a file audit. |
String |
getBasedir()
|
String |
normalize(String aPath)
"normalize" the given absolute path. |
int |
process(List<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(String aBasedir)
|
void |
setCharset(String aCharset)
Sets a named charset. |
void |
setClassloader(ClassLoader aLoader)
Sets the classloader that is used to contextualize filesetchecks. |
void |
setLocaleCountry(String aLocaleCountry)
|
void |
setLocaleLanguage(String aLocaleLanguage)
|
void |
setModuleClassLoader(ClassLoader aModuleClassLoader)
Sets the classloader used to load Checkstyle core and custom module classes when the module tree is being built up. |
void |
setModuleFactory(ModuleFactory aModuleFactory)
Sets the factory for creating submodules. |
void |
setSeverity(String aSeverity)
Sets the severity level. |
protected void |
setupChild(Configuration aChildConf)
Called by configure() for every child of this component's 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 occurs| Method Detail |
|---|
public void finishLocalSetup()
throws CheckstyleException
AutomaticBeanThe default implementation does nothing.
finishLocalSetup in class AutomaticBeanCheckstyleException - if there is a configuration error.
protected void setupChild(Configuration aChildConf)
throws CheckstyleException
AutomaticBeanThe default implementation does nothing.
setupChild in class AutomaticBeanaChildConf - a child of this component's Configuration
CheckstyleException - if there is a configuration error.Configuration.getChildren()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(List<File> aFiles)
aFiles - the list of files to be audited.
destroy()public void setBasedir(String aBasedir)
aBasedir - the base directory to strip off in filenamespublic String normalize(String aPath)
This includes:
aPath - a path for "normalizing"
NullPointerException - if the file path is
equal to null.public final String getBasedir()
protected void fireAuditStarted()
protected void fireAuditFinished()
public void fireFileStarted(String aFileName)
fireFileStarted in interface MessageDispatcheraFileName - the file to be auditedpublic void fireFileFinished(String aFileName)
fireFileFinished in interface MessageDispatcheraFileName - the audited file
public void fireErrors(String aFileName,
TreeSet<LocalizedMessage> aErrors)
fireErrors in interface MessageDispatcheraFileName - the audited fileaErrors - the audit errors from the filepublic void setModuleFactory(ModuleFactory aModuleFactory)
aModuleFactory - the factory for creating FileSetCheckspublic void setLocaleCountry(String aLocaleCountry)
aLocaleCountry - the country to report messagespublic void setLocaleLanguage(String aLocaleLanguage)
aLocaleLanguage - the language to report messagespublic final void setSeverity(String aSeverity)
SeverityLevel class.
aSeverity - The new severity levelSeverityLevelpublic final void setClassloader(ClassLoader aLoader)
aLoader - the new classloaderpublic final void setModuleClassLoader(ClassLoader aModuleClassLoader)
aModuleClassLoader - the classloader used to load module classes
public void setCharset(String aCharset)
throws UnsupportedEncodingException
aCharset - the name of a charset
UnsupportedEncodingException - if aCharset is unsupported.
|
Back to the Checkstyle Home Page | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||