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 Constructor Description AbstractMethodMetric()
-
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)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)MetricLevelgetBaseLevel()booleangetIncludeClosureFields()groovy.lang.MetaClassgetMetaClass()java.lang.ObjectgetProperty(java.lang.String property)java.lang.ObjectinvokeMethod(java.lang.String method, java.lang.Object arguments)booleanisIncludeClosureFields()protected intlineNumberForMethod(org.codehaus.groovy.ast.MethodNode methodNode)voidsetIncludeClosureFields(boolean 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, calculateForPackage, 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
-
-
-
-
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
-
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)
-
-