Class MetricFunction
- java.lang.Object
-
- net.sourceforge.pmd.lang.java.xpath.MetricFunction
-
- All Implemented Interfaces:
org.jaxen.Function
public class MetricFunction extends java.lang.Object implements org.jaxen.FunctionImplements themetric()XPath function. Takes the string name of a metric and the context node and returns the result if the metric can be computed, otherwise returnsDouble.NaN.- Since:
- 6.0.0
- Author:
- Clément Fournier
-
-
Constructor Summary
Constructors Constructor Description MetricFunction()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.lang.StringbadClassMetricKeyMessage()static java.lang.StringbadMetricKeyArgMessage()static java.lang.StringbadOperationMetricKeyMessage()java.lang.Objectcall(org.jaxen.Context context, java.util.List args)static java.lang.StringgenericBadNodeMessage()static doublegetMetric(net.sourceforge.pmd.lang.ast.Node n, java.lang.String metricKeyName)static voidregisterSelfInSimpleContext()
-
-
-
Method Detail
-
call
public java.lang.Object call(org.jaxen.Context context, java.util.List args) throws org.jaxen.FunctionCallException- Specified by:
callin interfaceorg.jaxen.Function- Throws:
org.jaxen.FunctionCallException
-
badOperationMetricKeyMessage
public static java.lang.String badOperationMetricKeyMessage()
-
badClassMetricKeyMessage
public static java.lang.String badClassMetricKeyMessage()
-
genericBadNodeMessage
public static java.lang.String genericBadNodeMessage()
-
badMetricKeyArgMessage
public static java.lang.String badMetricKeyArgMessage()
-
getMetric
public static double getMetric(net.sourceforge.pmd.lang.ast.Node n, java.lang.String metricKeyName)
-
registerSelfInSimpleContext
public static void registerSelfInSimpleContext()
-
-