org.inria.ns.reflex.xml.provider.jaxen
Class JaxenXFactory

java.lang.Object
  extended by org.inria.ns.reflex.xml.XFactory
      extended by org.inria.ns.reflex.xml.XFactory.Impl
          extended by org.inria.ns.reflex.xml.provider.jaxen.JaxenXFactory

public class JaxenXFactory
extends XFactory.Impl

A factory based on Jaxen that provides basic XML features.

Author:
Philippe Poulard

Nested Class Summary
 
Nested classes/interfaces inherited from class org.inria.ns.reflex.xml.XFactory
XFactory.Impl
 
Constructor Summary
JaxenXFactory()
           
 
Method Summary
 PatternContext getContextAdapter(PatternContext context)
          Adapt the given context for a specific implementation.
 XPathContext getContextAdapter(XPathContext context)
          Adapt the given context for a specific implementation.
static XFactory getInstance()
          Return the registered instance of the Jaxen factory.
 Pattern parsePattern(String pattern)
          Parse the XPath pattern to a compiled pattern.
 XPath parseXPath(String expression)
          Parse the XPath expression to a compile expression.
 
Methods inherited from class org.inria.ns.reflex.xml.XFactory.Impl
parseXPointer, parseXPointerPart
 
Methods inherited from class org.inria.ns.reflex.xml.XFactory
newInstance, newInstance
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JaxenXFactory

public JaxenXFactory()
Method Detail

getInstance

public static XFactory getInstance()
Return the registered instance of the Jaxen factory.


parseXPath

public XPath parseXPath(String expression)
                 throws XPathSyntaxException
Parse the XPath expression to a compile expression.

Specified by:
parseXPath in class XFactory
Parameters:
expression - The XPath expression to parse.
Returns:
The compiled XPath expression.
Throws:
XPathSyntaxException - If the XPath expression can't be parsed.

parsePattern

public Pattern parsePattern(String pattern)
                     throws BadPatternException
Parse the XPath pattern to a compiled pattern.

Specified by:
parsePattern in class XFactory
Parameters:
pattern - The pattern to compile.
Returns:
The compiled pattern.
Throws:
BadPatternException - If the pattern can't be parsed.

getContextAdapter

public XPathContext getContextAdapter(XPathContext context)
Adapt the given context for a specific implementation.

Specified by:
getContextAdapter in class XFactory
Parameters:
context - The context used when the XPath expression will be evaluated.
Returns:
A Jaxen XPath context castable to JaxenXPathContext.
See Also:
JaxenXPathContext

getContextAdapter

public PatternContext getContextAdapter(PatternContext context)
Adapt the given context for a specific implementation.

Specified by:
getContextAdapter in class XFactory
Parameters:
context - The context used when the XPath expression will be evaluated.
Returns:
A Jaxen XPath context castable to JaxenXPathContext.
See Also:
JaxenXPathContext