org.inria.ns.reflex.xml.xpath.xpointer
Class ComposedXPointer

java.lang.Object
  extended by org.inria.ns.reflex.xml.CompiledExpression.Impl
      extended by org.inria.ns.reflex.xml.xpath.xpointer.ComposedXPointer
All Implemented Interfaces:
CompiledExpression, XPointer

public class ComposedXPointer
extends CompiledExpression.Impl
implements XPointer

An XPointer made of several parts.

Each part is a scheme based XPointer part.

Author:
Philippe Poulard

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.inria.ns.reflex.xml.CompiledExpression
CompiledExpression.Impl
 
Constructor Summary
ComposedXPointer(List parts, XFactory factory)
          Create a composed XPointer.
 
Method Summary
 Pattern asPattern()
          Return this composed XPointer as a pattern
 Object evaluate(XPathContext context)
          The result returned by the first part that return a non-null result.
 
Methods inherited from class org.inria.ns.reflex.xml.CompiledExpression.Impl
getXFactory
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.inria.ns.reflex.xml.CompiledExpression
getXFactory
 

Constructor Detail

ComposedXPointer

public ComposedXPointer(List parts,
                        XFactory factory)
Create a composed XPointer.

Parameters:
parts - A list of XPointer schemes.
factory - The factory that creates this compiled expression.
See Also:
SchemeBased
Method Detail

evaluate

public Object evaluate(XPathContext context)
                throws XPathException
The result returned by the first part that return a non-null result.

Specified by:
evaluate in interface CompiledExpression
Parameters:
context - is the Context which gets evaluated.
Returns:
A result. null indicates an error.
Throws:
XPathException
See Also:
CompiledExpression.evaluate(org.inria.ns.reflex.xml.xpath.XPathContext)

asPattern

public Pattern asPattern()
                  throws BadPatternException
Return this composed XPointer as a pattern

Specified by:
asPattern in interface CompiledExpression
Returns:
This expression as a pattern.
Throws:
BadPatternException - If this expression can't be converted to a pattern.
See Also:
CompiledExpression.asPattern()