Class JaxenNsAwareXPathExecuter
- java.lang.Object
-
- net.sf.jasperreports.engine.util.xml.JaxenXPathExecuter
-
- net.sf.jasperreports.engine.util.xml.JaxenNsAwareXPathExecuter
-
- All Implemented Interfaces:
JRXPathExecuter
public class JaxenNsAwareXPathExecuter extends JaxenXPathExecuter
XPath executer implementation that uses a namespace aware Jaxen.- Author:
- Narcis Marcu (narcism@users.sourceforge.net)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.sf.jasperreports.engine.util.xml.JaxenXPathExecuter
JaxenXPathExecuter.NodeListWrapper
-
-
Field Summary
-
Fields inherited from class net.sf.jasperreports.engine.util.xml.JaxenXPathExecuter
EXCEPTION_MESSAGE_KEY_XPATH_COMPILATION_FAILURE, EXCEPTION_MESSAGE_KEY_XPATH_SELECTION_FAILURE
-
-
Constructor Summary
Constructors Constructor Description JaxenNsAwareXPathExecuter()Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddNamespaceContext(org.w3c.dom.Node contextNode, org.jaxen.XPath xPath, java.lang.String expression)protected booleancontainsPrefixes(java.lang.String expression)booleangetDetectXmlNamespaces()java.util.Map<java.lang.String,java.lang.String>getXmlNamespaceMap()protected org.jaxen.XPathgetXPath(org.w3c.dom.Node contextNode, java.lang.String expression)org.w3c.dom.NodeListselectNodeList(org.w3c.dom.Node contextNode, java.lang.String expression)Selects a node list by evaluating an XPath expression on a context node.java.lang.ObjectselectObject(org.w3c.dom.Node contextNode, java.lang.String expression)Selects an object by evaluating an XPath expression on a context node.voidsetDetectXmlNamespaces(boolean detectXmlNamespaces)voidsetXmlNamespaceMap(java.util.Map<java.lang.String,java.lang.String> xmlNamespaceMap)-
Methods inherited from class net.sf.jasperreports.engine.util.xml.JaxenXPathExecuter
getXPath
-
-
-
-
Method Detail
-
getXmlNamespaceMap
public java.util.Map<java.lang.String,java.lang.String> getXmlNamespaceMap()
-
setXmlNamespaceMap
public void setXmlNamespaceMap(java.util.Map<java.lang.String,java.lang.String> xmlNamespaceMap) throws JRException- Throws:
JRException
-
getDetectXmlNamespaces
public boolean getDetectXmlNamespaces()
-
setDetectXmlNamespaces
public void setDetectXmlNamespaces(boolean detectXmlNamespaces)
-
getXPath
protected org.jaxen.XPath getXPath(org.w3c.dom.Node contextNode, java.lang.String expression) throws JRException- Throws:
JRException
-
selectNodeList
public org.w3c.dom.NodeList selectNodeList(org.w3c.dom.Node contextNode, java.lang.String expression) throws JRExceptionDescription copied from interface:JRXPathExecuterSelects a node list by evaluating an XPath expression on a context node.- Specified by:
selectNodeListin interfaceJRXPathExecuter- Overrides:
selectNodeListin classJaxenXPathExecuter- Parameters:
contextNode- the context node (a document can also be used)expression- the XPath expression- Returns:
- the selected node list
- Throws:
JRException- if the XPath evaluation failed
-
selectObject
public java.lang.Object selectObject(org.w3c.dom.Node contextNode, java.lang.String expression) throws JRExceptionDescription copied from interface:JRXPathExecuterSelects an object by evaluating an XPath expression on a context node. If the expression evaluates to a node list, the first node in the list should be returned. Otherwise, the primitive value resulted from the evaluation should be returned as ajava.lang.String,java.lang.Numberorjava.lang.Boolean.- Specified by:
selectObjectin interfaceJRXPathExecuter- Overrides:
selectObjectin classJaxenXPathExecuter- Parameters:
contextNode- the context node (a document can also be used)expression- the XPath expression- Returns:
- the selected node or value
- Throws:
JRException- if the XPath evaluation failed
-
containsPrefixes
protected boolean containsPrefixes(java.lang.String expression)
-
addNamespaceContext
protected void addNamespaceContext(org.w3c.dom.Node contextNode, org.jaxen.XPath xPath, java.lang.String expression) throws JRException- Throws:
JRException
-
-