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.String
BASE_MESSAGES_BUNDLE
protected static java.lang.String
CODENARC_URL
protected static java.lang.String
CUSTOM_MESSAGES_BUNDLE
protected java.lang.String
customMessagesBundleName
protected groovy.lang.Closure
getTimestamp
protected groovy.lang.Closure
initializeResourceBundle
protected java.util.ResourceBundle
resourceBundle
protected static java.lang.String
VERSION_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.String
getCodeNarcVersion()
protected java.lang.String
getDescriptionForRule(Rule rule)
protected java.lang.String
getFormattedTimestamp()
protected java.lang.String
getHtmlDescriptionForRule(Rule rule)
groovy.lang.MetaClass
getMetaClass()
java.lang.String
getOutputFile()
java.lang.Object
getProperty(java.lang.String property)
protected java.lang.String
getResourceBundleString(java.lang.String resourceKey)
protected java.lang.String
getResourceBundleString(java.lang.String resourceKey, java.lang.String defaultString)
protected java.lang.String
getResourceBundleString(java.lang.String resourceKey, java.lang.String defaultString, boolean logWarning)
protected java.util.List
getSortedRules(AnalysisContext analysisContext)
java.lang.Object
getWriteToStandardOut()
protected void
initializeDefaultResourceBundle()
java.lang.Object
invokeMethod(java.lang.String method, java.lang.Object arguments)
protected boolean
isEnabled(Rule rule)
void
setMetaClass(groovy.lang.MetaClass mc)
void
setOutputFile(java.lang.String value)
void
setProperty(java.lang.String property, java.lang.Object value)
void
setWriteToStandardOut(java.lang.Object value)
abstract void
writeReport(java.io.Writer writer, AnalysisContext analysisContext, Results results)
void
writeReport(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:
getMetaClass
in interfacegroovy.lang.GroovyObject
-
setMetaClass
public void setMetaClass(groovy.lang.MetaClass mc)
- Specified by:
setMetaClass
in interfacegroovy.lang.GroovyObject
-
invokeMethod
public java.lang.Object invokeMethod(java.lang.String method, java.lang.Object arguments)
- Specified by:
invokeMethod
in interfacegroovy.lang.GroovyObject
-
getProperty
public java.lang.Object getProperty(java.lang.String property)
- Specified by:
getProperty
in interfacegroovy.lang.GroovyObject
-
setProperty
public void setProperty(java.lang.String property, java.lang.Object value)
- Specified by:
setProperty
in 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:
writeReport
in 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()
-
-