Package org.cip4.lib.xjdf.xml.internal
Class JAXBNavigator<T>
java.lang.Object
org.cip4.lib.xjdf.xml.internal.JAXBNavigator<T>
- Type Parameters:
T- Entity type.
Navigator class which simplifies XPath handling using any JAXB object.
-
Constructor Summary
ConstructorsConstructorDescriptionJAXBNavigator(T jaxbObj) Constructor performing the setup for simplifying XPath handling using any JAXB object. -
Method Summary
Modifier and TypeMethodDescriptionfinal JAXBNavigator<T>addNamespace(String prefix, String namespaceUri) Adds a namespace to the xpath.final DoubleevaluateDouble(String xPathExpression) Evaluates an XPath expression and returns an Double value as result.final IntegerevaluateInt(String xPathExpression) Evaluates an XPath expression and returns an Integer value as result.final ObjectevaluateNode(String xPathExpression) Evaluates an XPath expression and returns the Object.final Object[]evaluateNodeList(String xPathExpression) Evaluates an XPath expression.final StringevaluateString(String xPathExpression) Evaluates an XPath expression and returns an String value as result.final TgetRoot()Get the JAXB object.final JAXBNavigator<T>sync()Sync changes made on the object graph.
-
Constructor Details
-
JAXBNavigator
Constructor performing the setup for simplifying XPath handling using any JAXB object.- Parameters:
jaxbObj- The jaxb object to be bound.- Throws:
javax.xml.bind.JAXBException- If binding fails.ParserConfigurationException- If binding fails.
-
-
Method Details
-
evaluateInt
Evaluates an XPath expression and returns an Integer value as result.- Parameters:
xPathExpression- The expression to evaluate.- Returns:
- Evaluation result as Integer
- Throws:
XPathExpressionException- If an error occurs in the XPath expression.
-
evaluateDouble
Evaluates an XPath expression and returns an Double value as result.- Parameters:
xPathExpression- The expression to evaluate.- Returns:
- Evaluation result as Double
- Throws:
XPathExpressionException- If an error occurs in the XPath expression.
-
evaluateString
Evaluates an XPath expression and returns an String value as result.- Parameters:
xPathExpression- The expression to evaluate.- Returns:
- Evaluation result as String
- Throws:
XPathExpressionException- If an error occurs in the XPath expression.
-
evaluateNode
Evaluates an XPath expression and returns the Object.- Parameters:
xPathExpression- The expression to evaluate.- Returns:
- Evaluation result
- Throws:
XPathExpressionException- If an error occurs in the XPath expression.
-
evaluateNodeList
Evaluates an XPath expression. This method works only for xml node lists.- Parameters:
xPathExpression- The expression to evaluate.- Returns:
- Evaluation result
- Throws:
XPathExpressionException- If an error occurs in the XPath expression.
-
addNamespace
Adds a namespace to the xpath.- Parameters:
prefix- Namespace prefix.namespaceUri- URI of the namespace.- Returns:
- this JAXBNavigator
-
getRoot
Get the JAXB object.- Returns:
- JAXB object.
-
sync
public final JAXBNavigator<T> sync() throws javax.xml.bind.JAXBException, ParserConfigurationExceptionSync changes made on the object graph.- Returns:
- this JAXBNavigator
- Throws:
javax.xml.bind.JAXBException- If any unexpected problem occurs during the marshalling.ParserConfigurationException- If creating a W3C document fails.
-