Package org.gmetrics.metric
Class AbstractMetric
- java.lang.Object
-
- org.gmetrics.metric.AbstractMetric
-
- All Implemented Interfaces:
groovy.lang.GroovyObject,Metric
- Direct Known Subclasses:
AbstractCoberturaCoverageMetric,AbstractMethodMetric,AbstractPackageCouplingMetric,ClassCountMetric,ClassLineCountMetric,FieldCountMetric,MethodCountMetric
public abstract class AbstractMetric extends java.lang.Object implements Metric, groovy.lang.GroovyObject
-
-
Constructor Summary
Constructors Constructor Description AbstractMetric()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description ClassMetricResultapplyToClass(org.codehaus.groovy.ast.ClassNode classNode, SourceCode sourceCode)MetricResultapplyToPackage(java.lang.String path, java.lang.String packageName, java.util.Collection<MetricResult> childMetricResults)protected abstract ClassMetricResultcalculateForClass(org.codehaus.groovy.ast.ClassNode classNode, SourceCode sourceCode)protected MetricResultcalculateForPackage(java.lang.String path, java.lang.String packageName, java.util.Collection<MetricResult> childMetricResults)protected MetricResultcreateAggregateMetricResult(MetricLevel metricLevel, java.util.Collection<MetricResult> childMetricResults)protected MetricResultcreateAggregateMetricResult(MetricLevel metricLevel, java.util.Collection<MetricResult> childMetricResults, org.codehaus.groovy.ast.ASTNode node)booleangetEnabled()java.util.List<java.lang.String>getFunctions()groovy.lang.MetaClassgetMetaClass()java.lang.ObjectgetProperty(java.lang.String property)java.lang.ObjectinvokeMethod(java.lang.String method, java.lang.Object arguments)booleanisEnabled()protected booleanisNotAnInterface(org.codehaus.groovy.ast.ClassNode classNode)voidsetEnabled(boolean value)voidsetFunctions(java.util.List<java.lang.String> value)voidsetMetaClass(groovy.lang.MetaClass mc)voidsetProperty(java.lang.String property, java.lang.Object value)-
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
getBaseLevel, getName
-
-
-
-
Method Detail
-
createAggregateMetricResult
protected MetricResult createAggregateMetricResult(MetricLevel metricLevel, java.util.Collection<MetricResult> childMetricResults)
-
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
-
getEnabled
public boolean getEnabled()
-
setEnabled
public void setEnabled(boolean value)
-
getFunctions
public java.util.List<java.lang.String> getFunctions()
- Specified by:
getFunctionsin interfaceMetric
-
setFunctions
public void setFunctions(java.util.List<java.lang.String> value)
-
calculateForClass
protected abstract ClassMetricResult calculateForClass(org.codehaus.groovy.ast.ClassNode classNode, SourceCode sourceCode)
-
applyToPackage
public MetricResult applyToPackage(java.lang.String path, java.lang.String packageName, java.util.Collection<MetricResult> childMetricResults)
- Specified by:
applyToPackagein interfaceMetric
-
calculateForPackage
protected MetricResult calculateForPackage(java.lang.String path, java.lang.String packageName, java.util.Collection<MetricResult> childMetricResults)
-
applyToClass
public ClassMetricResult applyToClass(org.codehaus.groovy.ast.ClassNode classNode, SourceCode sourceCode)
- Specified by:
applyToClassin interfaceMetric
-
isNotAnInterface
protected boolean isNotAnInterface(org.codehaus.groovy.ast.ClassNode classNode)
-
createAggregateMetricResult
protected MetricResult createAggregateMetricResult(MetricLevel metricLevel, java.util.Collection<MetricResult> childMetricResults, org.codehaus.groovy.ast.ASTNode node)
-
-