org.plasma.sdo.xpath
Class DataGraphXPath

java.lang.Object
  extended by org.jaxen.BaseXPath
      extended by org.plasma.sdo.xpath.DefaultXPath
          extended by org.plasma.sdo.xpath.DataGraphXPath
All Implemented Interfaces:
java.io.Serializable, org.jaxen.XPath

public class DataGraphXPath
extends DefaultXPath

An XPath implementation for a data graph based on Jaxen.

This is the main entry point for matching an XPath against a data graph.

See Also:
Serialized Form

Constructor Summary
DataGraphXPath(java.lang.String xpathExpr)
           
DataGraphXPath(java.lang.String xpathExpr, org.jaxen.Navigator navigator)
           
 
Method Summary
 XPathDataObject[] findDataObjects(DataObject root)
          Returns an array of Data Object results, an error being thrown if other than Data Object results are found or if multiple results are found but the target Property is not a "many" Property, i.e.
 XPathDataProperty[] findProperties(DataObject root)
          Returns an array of Property results, an error being thrown if other than Property results are found.
 XPathDataProperty findProperty(DataObject root)
          Returns a single Property result or null if no Property results are found.
 org.jaxen.Context getNodeContext(java.lang.Object node)
           
 DataGraphNodeAdapter[] getResults(DataObject root)
          Returns an array with either 1 single result or multiple results, and error being thrown if no results are found or if multiple results are found but the target Property is not a "many" Property, i.e.
 
Methods inherited from class org.plasma.sdo.xpath.DefaultXPath
isXPath
 
Methods inherited from class org.jaxen.BaseXPath
addNamespace, booleanValueOf, createFunctionContext, createNamespaceContext, createVariableContext, debug, evaluate, getContext, getContextSupport, getFunctionContext, getNamespaceContext, getNavigator, getRootExpr, getVariableContext, numberValueOf, selectNodes, selectNodesForContext, selectSingleNode, selectSingleNodeForContext, setFunctionContext, setNamespaceContext, setVariableContext, stringValueOf, toString, valueOf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DataGraphXPath

public DataGraphXPath(java.lang.String xpathExpr)
               throws org.jaxen.JaxenException
Throws:
org.jaxen.JaxenException

DataGraphXPath

public DataGraphXPath(java.lang.String xpathExpr,
                      org.jaxen.Navigator navigator)
               throws org.jaxen.JaxenException
Throws:
org.jaxen.JaxenException
Method Detail

getNodeContext

public org.jaxen.Context getNodeContext(java.lang.Object node)

getResults

public DataGraphNodeAdapter[] getResults(DataObject root)
                                  throws org.jaxen.JaxenException,
                                         InvalidMultiplicityException
Returns an array with either 1 single result or multiple results, and error being thrown if no results are found or if multiple results are found but the target Property is not a "many" Property, i.e. a multi-valued Property. The target Property is the result or end point Property after resolving an XPATH.

Returns:
an array with either 1 single result or multiple results.
Throws:
IllegalXPathArgumentException - if no results are found or if multiple results are found but the target Property is not a "many" property, i.e. a multi-valued Property. The target Property is the result or end point Property after resolving an XPATH.
org.jaxen.JaxenException - as required by the Jaxen API
InvalidMultiplicityException - if the given XPATH resulted in multiple values for a singular property

findProperties

public XPathDataProperty[] findProperties(DataObject root)
                                   throws org.jaxen.JaxenException,
                                          InvalidEndpointException
Returns an array of Property results, an error being thrown if other than Property results are found.

Returns:
an array of Property results or zero length array if no results are found.
Throws:
org.jaxen.JaxenException - as required by the Jaxen API
InvalidEndpointException - when the result or terminating node or nodes are not Property nodes

findProperty

public XPathDataProperty findProperty(DataObject root)
                               throws org.jaxen.JaxenException,
                                      InvalidEndpointException
Returns a single Property result or null if no Property results are found.

Returns:
an array of Property results or null if no results are found.
Throws:
org.jaxen.JaxenException - as required by the Jaxen API
InvalidEndpointException - when the result or terminating node or nodes are not Property nodes

findDataObjects

public XPathDataObject[] findDataObjects(DataObject root)
                                  throws org.jaxen.JaxenException,
                                         InvalidEndpointException,
                                         InvalidMultiplicityException
Returns an array of Data Object results, an error being thrown if other than Data Object results are found or if multiple results are found but the target Property is not a "many" Property, i.e. a multi-valued property. The target Property is the result or end point Property after resolving an XPATH.

Returns:
an array of Data Object results.
Throws:
IllegalXPathArgumentException - if other than Data Object results are found or if multiple results are found but the target Property is not a "many" Property, i.e. a multi-valued Property. The target Property is the result or end point Property after resolving an XPATH.
org.jaxen.JaxenException - as required by the Jaxen API
InvalidEndpointException - when the result or terminating node or nodes for an XPATH expression are not Data Object nodes
InvalidMultiplicityException - when multiple results are detected for a singular property


Copyright © 2013. All Rights Reserved.