org.inria.ns.reflex.xml.xpath
Class XPathContext.Impl

java.lang.Object
  extended by org.inria.ns.reflex.xml.xpath.XPathContext.Impl
All Implemented Interfaces:
PatternContext, XPathContext
Direct Known Subclasses:
JaxenXPathContext
Enclosing interface:
XPathContext

public static class XPathContext.Impl
extends Object
implements XPathContext

Hold a context when evaluating an XPath expression. XPath contexts are needed when executing an XPath expression to retrieve variable values, functions and to resolve namespace URIs. A node set may also be used when evaluating relative XPath expression.

Author:
Philippe Poulard

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.inria.ns.reflex.xml.xpath.XPathContext
XPathContext.Impl
 
Constructor Summary
XPathContext.Impl(XFactory factory)
          Create a new XPath context.
XPathContext.Impl(XPathContext context)
          Create a new XPath context with the same fields as another context.
 
Method Summary
 NamespaceContext getNamespaceContext()
          Get the namespace context for prefix resolution.
 List getNodeSet()
          Get the node set used as the context.
 int getPosition()
          Get the position of the context.
 int getSize()
          Get the size of the context.
 XFactory getXFactory()
          Return the factory that built this XPath context.
 XPathFunctionResolver getXPathFunctionResolver()
          Get the resolver that is able to resolve XPath functions.
 XPathVariableResolver getXPathVariableResolver()
          Get the resolver that is able to retrieve the value of the variables.
 void setNamespaceContext(NamespaceContext nsContext)
          Set the namespace context for prefix resolution.
 void setNodeSet(List nodeSet)
          Set the node set used as the context.
 void setPosition(int position)
          Set the position of the context.
 void setSize(int size)
          Set the size of the context.
 void setXPathFunctionResolver(XPathFunctionResolver functionResolver)
          Set the resolver that is able to resolve XPath functions.
 void setXPathVariableResolver(XPathVariableResolver variableResolver)
          Set the resolver that is able to retrieve the value of the variables.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XPathContext.Impl

public XPathContext.Impl(XFactory factory)
Create a new XPath context.

Parameters:
factory - The factory that creates this context.

XPathContext.Impl

public XPathContext.Impl(XPathContext context)
Create a new XPath context with the same fields as another context.

Parameters:
context - The context.
Method Detail

getNamespaceContext

public NamespaceContext getNamespaceContext()
Get the namespace context for prefix resolution.

Specified by:
getNamespaceContext in interface PatternContext
Returns:
The namespace context that is able to retrieve namespace URIs, or null.

setNamespaceContext

public void setNamespaceContext(NamespaceContext nsContext)
Set the namespace context for prefix resolution.

Specified by:
setNamespaceContext in interface PatternContext
Parameters:
nsContext - The namespace context that is able to retrieve namespace URIs.

getXPathVariableResolver

public XPathVariableResolver getXPathVariableResolver()
Get the resolver that is able to retrieve the value of the variables.

Specified by:
getXPathVariableResolver in interface PatternContext
Returns:
The variable resolver, or null.

setXPathVariableResolver

public void setXPathVariableResolver(XPathVariableResolver variableResolver)
Set the resolver that is able to retrieve the value of the variables.

Specified by:
setXPathVariableResolver in interface PatternContext
Parameters:
variableResolver - The variable resolver.

getXPathFunctionResolver

public XPathFunctionResolver getXPathFunctionResolver()
Get the resolver that is able to resolve XPath functions.

Specified by:
getXPathFunctionResolver in interface PatternContext
Returns:
The resolver that is able to resolve XPath functions.

setXPathFunctionResolver

public void setXPathFunctionResolver(XPathFunctionResolver functionResolver)
Set the resolver that is able to resolve XPath functions.

Specified by:
setXPathFunctionResolver in interface PatternContext
Parameters:
functionResolver - The resolver that is able to resolve XPath functions.

getSize

public int getSize()
Get the size of the context.

Specified by:
getSize in interface XPathContext
Returns:
The size of the context.

setSize

public void setSize(int size)
Set the size of the context.

Specified by:
setSize in interface XPathContext
Parameters:
size - The size of the context.

getPosition

public int getPosition()
Get the position of the context.

Specified by:
getPosition in interface XPathContext
Returns:
The position of the context.

setPosition

public void setPosition(int position)
Set the position of the context.

Specified by:
setPosition in interface XPathContext
Parameters:
position - The position of the context.

getNodeSet

public List getNodeSet()
Get the node set used as the context.

Specified by:
getNodeSet in interface XPathContext
Returns:
The the node set used as the context.

setNodeSet

public void setNodeSet(List nodeSet)
Set the node set used as the context.

Specified by:
setNodeSet in interface XPathContext
Parameters:
nodeSet - The node set as the context to use.

getXFactory

public XFactory getXFactory()
Return the factory that built this XPath context.

Specified by:
getXFactory in interface PatternContext
Returns:
The factory that built this XPath context.