Package org.gmetrics.metric
Class AbstractMethodMetric
java.lang.Object
org.gmetrics.metric.AbstractMetric
org.gmetrics.metric.AbstractMethodMetric
- All Implemented Interfaces:
groovy.lang.GroovyObject,MethodMetric,Metric
- Direct Known Subclasses:
AbcMetric,CrapMetric,CyclomaticComplexityMetric,MethodLineCountMetric
public abstract class AbstractMethodMetric
extends AbstractMetric
implements MethodMetric, groovy.lang.GroovyObject
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapplyToClosure(org.codehaus.groovy.ast.expr.ClosureExpression closureExpression, SourceCode sourceCode) applyToMethod(org.codehaus.groovy.ast.MethodNode methodNode, SourceCode sourceCode) abstract MetricResultcalculate(org.codehaus.groovy.ast.expr.ClosureExpression closureExpression, SourceCode sourceCode) abstract MetricResultcalculate(org.codehaus.groovy.ast.MethodNode methodNode, SourceCode sourceCode) protected ClassMetricResultcalculateForClass(org.codehaus.groovy.ast.ClassNode classNode, SourceCode sourceCode) final MetricLevelbooleangroovy.lang.MetaClassgetProperty(String property) invokeMethod(String method, Object arguments) booleanprotected intlineNumberForMethod(org.codehaus.groovy.ast.MethodNode methodNode) voidsetIncludeClosureFields(boolean value) voidsetMetaClass(groovy.lang.MetaClass mc) voidsetProperty(String property, Object value) Methods inherited from class org.gmetrics.metric.AbstractMetric
applyToClass, applyToPackage, calculateForPackage, createAggregateMetricResult, createAggregateMetricResult, getEnabled, getFunctions, isEnabled, isNotAnInterface, setEnabled, setFunctionsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.gmetrics.metric.Metric
applyToClass, applyToPackage, getFunctions, getName, isEnabled
-
Constructor Details
-
AbstractMethodMetric
public AbstractMethodMetric()
-
-
Method Details
-
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
- Specified by:
invokeMethodin interfacegroovy.lang.GroovyObject- Overrides:
invokeMethodin classAbstractMetric
-
getProperty
- Specified by:
getPropertyin interfacegroovy.lang.GroovyObject- Overrides:
getPropertyin classAbstractMetric
-
setProperty
- Specified by:
setPropertyin interfacegroovy.lang.GroovyObject- Overrides:
setPropertyin classAbstractMetric
-
getBaseLevel
- Specified by:
getBaseLevelin interfaceMetric
-
getIncludeClosureFields
public boolean getIncludeClosureFields() -
isIncludeClosureFields
public boolean isIncludeClosureFields() -
setIncludeClosureFields
public void setIncludeClosureFields(boolean value) -
calculate
public abstract MetricResult calculate(org.codehaus.groovy.ast.MethodNode methodNode, SourceCode sourceCode) -
calculate
public abstract MetricResult calculate(org.codehaus.groovy.ast.expr.ClosureExpression closureExpression, SourceCode sourceCode) -
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
-
lineNumberForMethod
protected int lineNumberForMethod(org.codehaus.groovy.ast.MethodNode methodNode)
-