Package org.apache.commons.jxpath

# Interface ExpressionContext

All Known Implementing Classes:
  `AncestorContext`, `AttributeContext`, `ChildContext`, `DescendantContext`, `EvalContext`, `InitialContext`, `NamespaceContext`, `NodeSetContext`, `ParentContext`, `PrecedingOrFollowingContext`, `PredicateContext`, `RootContext`, `SelfContext`, `UnionContext`

public interface ExpressionContext
If an extenstion function has an argument of type ExpressionContext, it can gain access to the current node of an XPath expression context.

Example:

>      public class MyExtenstionFunctions {

>          public static String objectType(ExpressionContext context) {
>              Object value = context.getContextNodePointer().getValue();
>              if (value == null) {
>                  return "null";
>              }
>              return value.getClass().getName();
>          }
>      }

You can then register this extension function using a `ClassFunctions` object and call it like this:

>      "/descendent-or-self::node()[ns:objectType() = 'java.util.Date']"

This expression will find all nodes of the graph that are dates.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `List<Pointer>`
  `getContextNodeList()`
  Gets the current context node list.
  `Pointer`
  `getContextNodePointer()`
  Gets the current context node.
  `JXPathContext`
  `getJXPathContext()`
  Gets the JXPathContext in which this function is being evaluated.
  `int`
  `getPosition()`
  Returns the current context position.

- ## Method Details

  - ### getContextNodeList

    List<Pointer> getContextNodeList()
    Gets the current context node list. Each element of the list is a Pointer.
    Returns:
      A list representing the current context nodes.

  - ### getContextNodePointer

    Pointer getContextNodePointer()
    Gets the current context node.
    Returns:
      The current context node pointer.

  - ### getJXPathContext

    JXPathContext getJXPathContext()
    Gets the JXPathContext in which this function is being evaluated.
    Returns:
      A list representing the current context nodes.

  - ### getPosition

    int getPosition()
    Returns the current context position.
    Returns:
      int