|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
If an extenstion function has an argument of type ExpressionContext, it can gain access to the current node of an XPath expression context.
Example:
You can then register this extension function using apublic class MyExtenstionFunctions { public static String objectType(ExpressionContext context){ Object value = context.getContextNodePointer().getValue(); if (value == null){ return "null"; } return value.getClass().getName(); } }
ClassFunctions
object and call it like this:
This expression will find all nodes of the graph that are dates."/descendent-or-self::node()[ns:objectType() = 'java.util.Date']"
Method Summary | |
java.util.List |
getContextNodeList()
Get the current context node list. |
Pointer |
getContextNodePointer()
Get the current context node. |
JXPathContext |
getJXPathContext()
Get the JXPathContext in which this function is being evaluated. |
int |
getPosition()
Returns the current context position. |
Method Detail |
public JXPathContext getJXPathContext()
public Pointer getContextNodePointer()
public java.util.List getContextNodeList()
public int getPosition()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |