Package org.gmetrics.metric.coverage
Class AbstractCoberturaCoverageMetric
- java.lang.Object
-
- org.gmetrics.metric.AbstractMetric
-
- org.gmetrics.metric.coverage.AbstractCoberturaCoverageMetric
-
- All Implemented Interfaces:
groovy.lang.GroovyObject,MethodMetric,Metric
- Direct Known Subclasses:
CoberturaBranchCoverageMetric,CoberturaLineCoverageMetric
public abstract class AbstractCoberturaCoverageMetric extends AbstractMetric implements MethodMetric
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.ObjectLOGprotected static intROUNDING_MODEprotected static intSCALE
-
Constructor Summary
Constructors Constructor Description AbstractCoberturaCoverageMetric()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description MetricResultapplyToClosure(org.codehaus.groovy.ast.expr.ClosureExpression closureExpression, SourceCode sourceCode)MetricResultapplyToMethod(org.codehaus.groovy.ast.MethodNode methodNode, SourceCode sourceCode)MetricResultcalculate(org.codehaus.groovy.ast.MethodNode methodNode, SourceCode sourceCode)protected ClassMetricResultcalculateForClass(org.codehaus.groovy.ast.ClassNode classNode, SourceCode sourceCode)protected MetricResultcalculateForPackage(java.lang.String packagePath, java.lang.String packageName, java.util.Collection<MetricResult> childMetricResults)protected SingleNumberMetricResultcalculateMethodResult(org.codehaus.groovy.ast.MethodNode methodNode, groovy.util.slurpersupport.GPathResult classXmlElement)protected groovy.util.slurpersupport.GPathResultfindMethodElement(org.codehaus.groovy.ast.MethodNode methodNode, groovy.util.slurpersupport.GPathResult classXmlElement)protected abstract java.lang.StringgetAttributeName()MetricLevelgetBaseLevel()java.lang.StringgetCoberturaFile()protected RatiogetCoverageRatioForClass(java.lang.String className)protected abstract RatiogetCoverageRatioForSingleClass(java.lang.Object matchingClassElement)groovy.lang.MetaClassgetMetaClass()java.lang.ObjectgetProperty(java.lang.String property)java.lang.ObjectinvokeMethod(java.lang.String method, java.lang.Object arguments)voidsetCoberturaFile(java.lang.String value)voidsetMetaClass(groovy.lang.MetaClass mc)voidsetProperty(java.lang.String property, java.lang.Object value)-
Methods inherited from class org.gmetrics.metric.AbstractMetric
applyToClass, applyToPackage, createAggregateMetricResult, createAggregateMetricResult, getEnabled, getFunctions, isEnabled, isNotAnInterface, setEnabled, setFunctions
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.gmetrics.metric.Metric
applyToClass, applyToPackage, getFunctions, getName, isEnabled
-
-
-
-
Field Detail
-
SCALE
protected static final int SCALE
- See Also:
- Constant Field Values
-
ROUNDING_MODE
protected static final int ROUNDING_MODE
-
LOG
protected static final java.lang.Object LOG
-
-
Method Detail
-
getMetaClass
public groovy.lang.MetaClass getMetaClass()
- Specified by:
getMetaClassin interfacegroovy.lang.GroovyObject- Overrides:
getMetaClassin classAbstractMetric
-
setMetaClass
public void setMetaClass(groovy.lang.MetaClass mc)
- Specified by:
setMetaClassin interfacegroovy.lang.GroovyObject- Overrides:
setMetaClassin classAbstractMetric
-
invokeMethod
public java.lang.Object invokeMethod(java.lang.String method, java.lang.Object arguments)- Specified by:
invokeMethodin interfacegroovy.lang.GroovyObject- Overrides:
invokeMethodin classAbstractMetric
-
getProperty
public java.lang.Object getProperty(java.lang.String property)
- Specified by:
getPropertyin interfacegroovy.lang.GroovyObject- Overrides:
getPropertyin classAbstractMetric
-
setProperty
public void setProperty(java.lang.String property, java.lang.Object value)- Specified by:
setPropertyin interfacegroovy.lang.GroovyObject- Overrides:
setPropertyin classAbstractMetric
-
getBaseLevel
public final MetricLevel getBaseLevel()
- Specified by:
getBaseLevelin interfaceMetric
-
getCoberturaFile
public java.lang.String getCoberturaFile()
-
setCoberturaFile
public void setCoberturaFile(java.lang.String value)
-
getAttributeName
protected abstract java.lang.String getAttributeName()
-
getCoverageRatioForSingleClass
protected abstract Ratio getCoverageRatioForSingleClass(java.lang.Object matchingClassElement)
-
applyToMethod
public MetricResult applyToMethod(org.codehaus.groovy.ast.MethodNode methodNode, SourceCode sourceCode)
- Specified by:
applyToMethodin interfaceMethodMetric
-
applyToClosure
public MetricResult applyToClosure(org.codehaus.groovy.ast.expr.ClosureExpression closureExpression, SourceCode sourceCode)
- Specified by:
applyToClosurein interfaceMethodMetric
-
calculateForClass
protected ClassMetricResult calculateForClass(org.codehaus.groovy.ast.ClassNode classNode, SourceCode sourceCode)
- Specified by:
calculateForClassin classAbstractMetric
-
calculateForPackage
protected MetricResult calculateForPackage(java.lang.String packagePath, java.lang.String packageName, java.util.Collection<MetricResult> childMetricResults)
- Overrides:
calculateForPackagein classAbstractMetric
-
calculate
public MetricResult calculate(org.codehaus.groovy.ast.MethodNode methodNode, SourceCode sourceCode)
-
getCoverageRatioForClass
protected Ratio getCoverageRatioForClass(java.lang.String className)
-
calculateMethodResult
protected SingleNumberMetricResult calculateMethodResult(org.codehaus.groovy.ast.MethodNode methodNode, groovy.util.slurpersupport.GPathResult classXmlElement)
-
findMethodElement
protected groovy.util.slurpersupport.GPathResult findMethodElement(org.codehaus.groovy.ast.MethodNode methodNode, groovy.util.slurpersupport.GPathResult classXmlElement)
-
-