public class Checker extends AutomaticBean implements MessageDispatcher
コンストラクタと説明 |
---|
Checker()
Creates a new
Checker instance. |
修飾子とタイプ | メソッドと説明 |
---|---|
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() |
int |
getErrorScore()
return score for error.
|
int |
getInfoScore()
return score for info.
|
String |
getmScoring() |
int |
getWarningScore()
return score for warning.
|
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 |
setErrorScore(int mErrorScore) |
void |
setInfoScore(int mInfoScore) |
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 |
setmScoring(String mScoring)
set logic to calculate score.
|
void |
setSeverity(String aSeverity)
Sets the severity level.
|
protected void |
setupChild(Configuration aChildConf)
Called by configure() for every child of this component's Configuration.
|
void |
setWarningScore(int mWarningScore) |
configure, contextualize, getConfiguration
public Checker() throws CheckstyleException
Checker
instance.
The instance needs to be contextualized and configured.CheckstyleException
- if an error occurspublic void finishLocalSetup() throws CheckstyleException
AutomaticBean
The default implementation does nothing.
finishLocalSetup
クラス内 AutomaticBean
CheckstyleException
- if there is a configuration error.protected void setupChild(Configuration aChildConf) throws CheckstyleException
AutomaticBean
The default implementation does nothing.
setupChild
クラス内 AutomaticBean
aChildConf
- a child of this component's ConfigurationCheckstyleException
- 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 final 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
インタフェース内 MessageDispatcher
aFileName
- the file to be auditedpublic void fireFileFinished(String aFileName)
fireFileFinished
インタフェース内 MessageDispatcher
aFileName
- the audited filepublic void fireErrors(String aFileName, TreeSet<LocalizedMessage> aErrors)
fireErrors
インタフェース内 MessageDispatcher
aFileName
- 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 levelSeverityLevel
public final void setClassloader(ClassLoader aLoader)
aLoader
- the new classloaderpublic final void setModuleClassLoader(ClassLoader aModuleClassLoader)
aModuleClassLoader
- the classloader used to load module classespublic void setCharset(String aCharset) throws UnsupportedEncodingException
aCharset
- the name of a charsetUnsupportedEncodingException
- if aCharset is unsupported.public int getInfoScore()
public void setInfoScore(int mInfoScore)
public int getWarningScore()
public void setWarningScore(int mWarningScore)
public int getErrorScore()
public void setErrorScore(int mErrorScore)
public String getmScoring()
public void setmScoring(String mScoring)
Copyright © 2001-2013. All Rights Reserved.