Class XPathFunctionDefinition
- java.lang.Object
-
- net.sourceforge.pmd.lang.rule.xpath.impl.XPathFunctionDefinition
-
public abstract class XPathFunctionDefinition extends Object
Base impl for an XPath function definition.- Since:
- 7.0.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
XPathFunctionDefinition.FunctionCall
Provides the actual implementation of a custom XPath function.static class
XPathFunctionDefinition.Type
Supported types of a custom XPath function.
-
Constructor Summary
Constructors Modifier Constructor Description protected
XPathFunctionDefinition(String localName)
protected
XPathFunctionDefinition(String localName, Language language)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
dependsOnContext()
If the function depends on the context item, then this method should returntrue
.XPathFunctionDefinition.Type[]
getArgumentTypes()
Defines the types of the function arguments.QName
getQName()
abstract XPathFunctionDefinition.Type
getResultType()
Defines the return type of the function.abstract XPathFunctionDefinition.FunctionCall
makeCallExpression()
Create a call on this function.
-
-
-
Method Detail
-
getQName
public final QName getQName()
-
getArgumentTypes
public XPathFunctionDefinition.Type[] getArgumentTypes()
Defines the types of the function arguments. By default, an empty array is returned, indicating that the function takes no arguments.
-
getResultType
public abstract XPathFunctionDefinition.Type getResultType()
Defines the return type of the function.
-
dependsOnContext
public boolean dependsOnContext()
If the function depends on the context item, then this method should returntrue
.Note: Only if this is true, the contextNode parameter will be present in the
XPathFunctionDefinition.FunctionCall.call(Node, Object[])
method.
-
makeCallExpression
public abstract XPathFunctionDefinition.FunctionCall makeCallExpression()
Create a call on this function. This method is called, when a function call is found in the XPath expression.
-
-