Package org.codenarc.report
Class AbstractReportWriter
- java.lang.Object
-
- org.codenarc.report.AbstractReportWriter
-
- All Implemented Interfaces:
groovy.lang.GroovyObject,ReportWriter
- Direct Known Subclasses:
AbstractHtmlReportWriter,BaselineXmlReportWriter,TextReportWriter,XmlReportWriter
public abstract class AbstractReportWriter extends java.lang.Object implements ReportWriter, groovy.lang.GroovyObject
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.StringBASE_MESSAGES_BUNDLEprotected static java.lang.StringCODENARC_URLprotected static java.lang.StringCUSTOM_MESSAGES_BUNDLEprotected java.lang.StringcustomMessagesBundleNameprotected groovy.lang.ClosuregetTimestampprotected groovy.lang.ClosureinitializeResourceBundleprotected java.util.ResourceBundleresourceBundleprotected static java.lang.StringVERSION_FILE
-
Constructor Summary
Constructors Constructor Description AbstractReportWriter()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected java.lang.StringgetCodeNarcVersion()protected java.lang.StringgetDescriptionForRule(Rule rule)protected java.lang.StringgetFormattedTimestamp()protected java.lang.StringgetHtmlDescriptionForRule(Rule rule)groovy.lang.MetaClassgetMetaClass()java.lang.StringgetOutputFile()java.lang.ObjectgetProperty(java.lang.String property)protected java.lang.StringgetResourceBundleString(java.lang.String resourceKey)protected java.lang.StringgetResourceBundleString(java.lang.String resourceKey, java.lang.String defaultString)protected java.lang.StringgetResourceBundleString(java.lang.String resourceKey, java.lang.String defaultString, boolean logWarning)protected java.util.ListgetSortedRules(AnalysisContext analysisContext)java.lang.ObjectgetWriteToStandardOut()protected voidinitializeDefaultResourceBundle()java.lang.ObjectinvokeMethod(java.lang.String method, java.lang.Object arguments)protected booleanisEnabled(Rule rule)voidsetMetaClass(groovy.lang.MetaClass mc)voidsetOutputFile(java.lang.String value)voidsetProperty(java.lang.String property, java.lang.Object value)voidsetWriteToStandardOut(java.lang.Object value)abstract voidwriteReport(java.io.Writer writer, AnalysisContext analysisContext, Results results)voidwriteReport(AnalysisContext analysisContext, Results results)
-
-
-
Field Detail
-
BASE_MESSAGES_BUNDLE
protected static final java.lang.String BASE_MESSAGES_BUNDLE
- See Also:
- Constant Field Values
-
CUSTOM_MESSAGES_BUNDLE
protected static final java.lang.String CUSTOM_MESSAGES_BUNDLE
- See Also:
- Constant Field Values
-
VERSION_FILE
protected static final java.lang.String VERSION_FILE
- See Also:
- Constant Field Values
-
CODENARC_URL
protected static final java.lang.String CODENARC_URL
- See Also:
- Constant Field Values
-
getTimestamp
protected groovy.lang.Closure getTimestamp
-
customMessagesBundleName
protected java.lang.String customMessagesBundleName
-
resourceBundle
protected java.util.ResourceBundle resourceBundle
-
initializeResourceBundle
protected groovy.lang.Closure initializeResourceBundle
-
-
Method Detail
-
getResourceBundleString
protected java.lang.String getResourceBundleString(java.lang.String resourceKey, java.lang.String defaultString)
-
getResourceBundleString
protected java.lang.String getResourceBundleString(java.lang.String resourceKey)
-
getMetaClass
public groovy.lang.MetaClass getMetaClass()
- Specified by:
getMetaClassin interfacegroovy.lang.GroovyObject
-
setMetaClass
public void setMetaClass(groovy.lang.MetaClass mc)
- Specified by:
setMetaClassin interfacegroovy.lang.GroovyObject
-
invokeMethod
public java.lang.Object invokeMethod(java.lang.String method, java.lang.Object arguments)- Specified by:
invokeMethodin interfacegroovy.lang.GroovyObject
-
getProperty
public java.lang.Object getProperty(java.lang.String property)
- Specified by:
getPropertyin interfacegroovy.lang.GroovyObject
-
setProperty
public void setProperty(java.lang.String property, java.lang.Object value)- Specified by:
setPropertyin interfacegroovy.lang.GroovyObject
-
getOutputFile
public java.lang.String getOutputFile()
-
setOutputFile
public void setOutputFile(java.lang.String value)
-
getWriteToStandardOut
public java.lang.Object getWriteToStandardOut()
-
setWriteToStandardOut
public void setWriteToStandardOut(java.lang.Object value)
-
writeReport
public abstract void writeReport(java.io.Writer writer, AnalysisContext analysisContext, Results results)
-
writeReport
public void writeReport(AnalysisContext analysisContext, Results results)
- Specified by:
writeReportin interfaceReportWriter
-
initializeDefaultResourceBundle
protected void initializeDefaultResourceBundle()
-
getHtmlDescriptionForRule
protected java.lang.String getHtmlDescriptionForRule(Rule rule)
-
getDescriptionForRule
protected java.lang.String getDescriptionForRule(Rule rule)
-
getResourceBundleString
protected java.lang.String getResourceBundleString(java.lang.String resourceKey, java.lang.String defaultString, boolean logWarning)
-
getFormattedTimestamp
protected java.lang.String getFormattedTimestamp()
-
getSortedRules
protected java.util.List getSortedRules(AnalysisContext analysisContext)
-
isEnabled
protected boolean isEnabled(Rule rule)
-
getCodeNarcVersion
protected java.lang.String getCodeNarcVersion()
-
-