|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.virtualweaver.xotics.datamodel.xpath.function.XpfAbstractFunction
This class is a default base implementation for an XPath function. To create a new
XPath function, this class should be derived by implementing one of the two evaluate()
methods : generally, evaluate(XpContext, XoDataType[])
method is used, as
XpEvaluable
arguments have been resolved by a call to XpEvaluable.evaluate(XpContext)
.
However, to have full control on how XpEvaluable
arguments are resolved, the other method
evaluate(XpContext, XpEvaluable[])
can be rewritten.
Field Summary | |
protected int |
column
|
protected int |
line
|
Constructor Summary | |
XpfAbstractFunction()
|
Method Summary | |
XoDataType |
evaluate(XpContext ectx,
XoDataType[] args)
default implementation consists in implementing this method. |
XoDataType |
evaluate(XpContext ectx,
XpEvaluable[] arguments)
This method resolves arguments by calling XpEvaluable.evaluate(XpContext) ,
then call evaluate(XpContext, XoDataType[]) with resolved arguments. |
abstract java.lang.String |
getLocalName()
Returns the local name of the function |
abstract java.lang.String |
getNameSpace()
Returns the namespace of the function |
void |
setTokenPosition(int line,
int col)
This method is called by XPath engine to give positions of this in XPath request
string. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected int line
protected int column
Constructor Detail |
public XpfAbstractFunction()
Method Detail |
public XoDataType evaluate(XpContext ectx, XpEvaluable[] arguments) throws XoException
arguments
by calling XpEvaluable.evaluate(XpContext)
,
then call evaluate(XpContext, XoDataType[])
with resolved arguments. So, default
implementation consists to let this method unchanged and implement the other method, but this
method can be rewritten as needed.
evaluate
in interface XpFunction
ectx
- dynamic XPath contextarguments
- function arguments
XoException
- if some error occurs.public XoDataType evaluate(XpContext ectx, XoDataType[] args) throws XoException
ectx
- dynamic XPath contextargs
- function arguments
XoException
- if some error occurs.public abstract java.lang.String getLocalName()
XpFunction
getLocalName
in interface XpFunction
XpFunction.getLocalName()
public abstract java.lang.String getNameSpace()
XpFunction
getNameSpace
in interface XpFunction
XpFunction.getNameSpace()
public void setTokenPosition(int line, int col)
XpFunction
this
in XPath request
string.
setTokenPosition
in interface XpFunction
line
- line position of this function in XPath requestcol
- column position of this function in XPath requestXpFunction.setTokenPosition(int, int)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |