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
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapplyToClass
(org.codehaus.groovy.ast.ClassNode classNode, SourceCode sourceCode) applyToPackage
(String path, String packageName, Collection<MetricResult> childMetricResults) protected abstract ClassMetricResult
calculateForClass
(org.codehaus.groovy.ast.ClassNode classNode, SourceCode sourceCode) protected MetricResult
calculateForPackage
(String path, String packageName, Collection<MetricResult> childMetricResults) protected MetricResult
createAggregateMetricResult
(MetricLevel metricLevel, Collection<MetricResult> childMetricResults) protected MetricResult
createAggregateMetricResult
(MetricLevel metricLevel, Collection<MetricResult> childMetricResults, org.codehaus.groovy.ast.ASTNode node) boolean
groovy.lang.MetaClass
getProperty
(String property) invokeMethod
(String method, Object arguments) boolean
protected boolean
isNotAnInterface
(org.codehaus.groovy.ast.ClassNode classNode) void
setEnabled
(boolean value) void
setFunctions
(List<String> value) void
setMetaClass
(groovy.lang.MetaClass mc) void
setProperty
(String property, 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
-
Constructor Details
-
AbstractMetric
public AbstractMetric()
-
-
Method Details
-
createAggregateMetricResult
protected MetricResult createAggregateMetricResult(MetricLevel metricLevel, Collection<MetricResult> childMetricResults) -
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
- Specified by:
invokeMethod
in interfacegroovy.lang.GroovyObject
-
getProperty
- Specified by:
getProperty
in interfacegroovy.lang.GroovyObject
-
setProperty
- Specified by:
setProperty
in interfacegroovy.lang.GroovyObject
-
getEnabled
public boolean getEnabled() -
isEnabled
public boolean isEnabled() -
setEnabled
public void setEnabled(boolean value) -
getFunctions
- Specified by:
getFunctions
in interfaceMetric
-
setFunctions
-
calculateForClass
protected abstract ClassMetricResult calculateForClass(org.codehaus.groovy.ast.ClassNode classNode, SourceCode sourceCode) -
applyToPackage
public MetricResult applyToPackage(String path, String packageName, Collection<MetricResult> childMetricResults) - Specified by:
applyToPackage
in interfaceMetric
-
calculateForPackage
protected MetricResult calculateForPackage(String path, String packageName, Collection<MetricResult> childMetricResults) -
applyToClass
public ClassMetricResult applyToClass(org.codehaus.groovy.ast.ClassNode classNode, SourceCode sourceCode) - Specified by:
applyToClass
in interfaceMetric
-
isNotAnInterface
protected boolean isNotAnInterface(org.codehaus.groovy.ast.ClassNode classNode) -
createAggregateMetricResult
protected MetricResult createAggregateMetricResult(MetricLevel metricLevel, Collection<MetricResult> childMetricResults, org.codehaus.groovy.ast.ASTNode node)
-