Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jaxen
Class Context

    java.lang.Object
      org.jaxen.Context

All Implemented Interfaces:
  Serializable

public class Context
extends Object
implements Serializable

Wrapper around implementation-specific objects used as the context of an expression evaluation.

NOTE: This class is not typically used directly, but is exposed for writers of implementation-specific XPath packages.

The `Context` bundles utilities together for evaluation of the expression. It wraps the provided objects for ease-of-passage through the expression AST.

Author:
  bob mcwhirter
See Also:
  `ContextSupport`, `BaseXPath`, `XPath for dom4j`, `XPath for JDOM`, `XPath for W3C DOM`, Serialized Form

Constructor Summary
`Context(ContextSupport contextSupport)` Create a new context.

Method Summary
`Context` | `duplicate()` Create a type-safe shallow copy.
`ContextSupport` | `getContextSupport()` Retrieve the `ContextSupport`.
`Function` | `getFunction(String namespaceURI, String prefix, String localName)` Retrieve a `Function`.
`Navigator` | `getNavigator()` Retrieve the current `Navigator`.
`List` | `getNodeSet()` Retrieve the context node-set.
`int` | `getPosition()` Retrieve current position in the context node-set.
`int` | `getSize()` Retrieve the size of the context node-set.
`Object` | `getVariableValue(String namespaceURI, String prefix, String localName)` Retrieve a variable value.
`void` | `setContextSupport(ContextSupport contextSupport)` Set the `ContextSupport`.
`void` | `setNodeSet(List nodeSet)` Set the context node-set.
`void` | `setPosition(int position)` Set the current position in the context node-set.
`void` | `setSize(int size)` Set the current size in the context node-set.
`String` | `translateNamespacePrefixToUri(String prefix)` Translate a namespace prefix to its URI.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### Context

    public Context(ContextSupport contextSupport)

  Create a new context.

Parameters:
  `contextSupport` - the context-support

Method Detail

### setNodeSet

    public void setNodeSet(List nodeSet)

  Set the context node-set.

  Parameters:
    `nodeSet` - the context node-set

### getNodeSet

    public List getNodeSet()

  Retrieve the context node-set.

  Returns:
    the context node-set

### setContextSupport

    public void setContextSupport(ContextSupport contextSupport)

  Set the `ContextSupport`.

  Parameters:
    `contextSupport` - the context-support

### getContextSupport

    public ContextSupport getContextSupport()

  Retrieve the `ContextSupport`.

  Returns:
    the context-support

### getNavigator

    public Navigator getNavigator()

  Retrieve the current `Navigator`.

  Returns:
    the navigator

### translateNamespacePrefixToUri

    public String translateNamespacePrefixToUri(String prefix)

  Translate a namespace prefix to its URI.

  Parameters:
    `prefix` - the prefix
  Returns:
    the namespace URI mapped to the prefix

### getVariableValue

    public Object getVariableValue(String namespaceURI,
                                   String prefix,
                                   String localName)
                            throws UnresolvableException

  Retrieve a variable value.

  Parameters:
    `namespaceURI` - the function namespace URI
    `prefix` - the function prefix
    `localName` - the function name
  Returns:
    the variable value
  Throws:
    `UnresolvableException` - if unable to locate a bound variable

### getFunction

    public Function getFunction(String namespaceURI,
                                String prefix,
                                String localName)
                         throws UnresolvableException

  Retrieve a `Function`.

  Parameters:
    `namespaceURI` - the function namespace URI
    `prefix` - the function prefix
    `localName` - the function name
  Returns:
    the function object
  Throws:
    `UnresolvableException` - if unable to locate a bound function

### setSize

    public void setSize(int size)

  Set the current size in the context node-set.

  Parameters:
    `size` - the size

### getSize

    public int getSize()

  Retrieve the size of the context node-set.

  Returns:
    the size

### setPosition

    public void setPosition(int position)

  Set the current position in the context node-set.

  Parameters:
    `position` - the position

### getPosition

    public int getPosition()

  Retrieve current position in the context node-set.

  Returns:
    the current position

### duplicate

    public Context duplicate()

  Create a type-safe shallow copy.

  Returns:
    the duplicate

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2005 Codehaus. All Rights Reserved.