org.inria.ns.reflex.xml
Class XFactory.Impl

java.lang.Object
  extended by org.inria.ns.reflex.xml.XFactory
      extended by org.inria.ns.reflex.xml.XFactory.Impl
Direct Known Subclasses:
JaxenXFactory
Enclosing class:
XFactory

public abstract static class XFactory.Impl
extends XFactory

A partial implementation of an XFactory that provides a support of the XPointer framework.

A concrete XFactory should override parseXPointerPart(QName, String) if specific XPointer schemes have to be added.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.inria.ns.reflex.xml.XFactory
XFactory.Impl
 
Constructor Summary
XFactory.Impl()
           
 
Method Summary
 XPointer parseXPointer(String expression, NamespaceContext namespaceContext)
          Parse the XPointer expression to a compiled expression.
 XPointer parseXPointerPart(QName scheme, String schemeData)
          Create a single XPointer part.
 
Methods inherited from class org.inria.ns.reflex.xml.XFactory
getContextAdapter, getContextAdapter, newInstance, newInstance, parsePattern, parseXPath
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XFactory.Impl

public XFactory.Impl()
Method Detail

parseXPointer

public XPointer parseXPointer(String expression,
                              NamespaceContext namespaceContext)
                       throws XPointerSyntaxException
Parse the XPointer expression to a compiled expression.

This implementation will use the XPath engine of the concrete factory.

A concrete XFactory should override parseXPointerPart(QName, String) if specific schemes must be added.

Specified by:
parseXPointer in class XFactory
Parameters:
expression - The XPointer expression to parse.
namespaceContext - The namespace context used to resolve prefixes. If a namespace binding context is encountered, it is added to the namespace context to use. The namespace context is restored to its original bindings.
Returns:
The compiled XPointer expression.
Throws:
XPointerSyntaxException - If the XPointer expression can't be parsed.

parseXPointerPart

public XPointer parseXPointerPart(QName scheme,
                                  String schemeData)
                           throws XPointerSyntaxException
Create a single XPointer part.

If overriden, a custom factory class should call the parent method that would process the default schemes defined here.

Parameters:
scheme - The name of the scheme.
schemeData - The (escaped) data of the scheme.
Returns:
This default implementation support the following XPointer schemes :
  • element() (the NCName "element")
  • xmlns() (the NCName "xmlns")
  • xpointer() (the NCName "xpointer")

Otherwise, it returns null.

*** The xpointer() scheme is currently not fully implemented : only XPath expressions are supported. ***

Throws:
XPointerSyntaxException - When the scheme data can't be parsed.
See Also:
XMLNames.ELEMENT_XPOINTER_SCHEME, ElementScheme, XMLNames.XMLNS_XPOINTER_SCHEME, XmlnsScheme, XMLNames.XPOINTER_XPOINTER_SCHEME, XPointerScheme