net.sf.jasperreports.engine.util.xml
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.
- Version:
- $Id: JaxenNsAwareXPathExecuter.java 5180 2012-03-29 13:23:12Z teodord $
- Author:
- Narcis Marcu (narcism@users.sourceforge.net)
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JaxenNsAwareXPathExecuter
public JaxenNsAwareXPathExecuter()
- Default constructor.
getXmlNamespaceMap
public Map<String,String> getXmlNamespaceMap()
setXmlNamespaceMap
public void setXmlNamespaceMap(Map<String,String> xmlNamespaceMap)
throws JRException
- Throws:
JRException
getDetectXmlNamespaces
public boolean getDetectXmlNamespaces()
setDetectXmlNamespaces
public void setDetectXmlNamespaces(boolean detectXmlNamespaces)
getXPath
protected org.jaxen.XPath getXPath(Node contextNode,
String expression)
throws JRException
- Throws:
JRException
selectNodeList
public NodeList selectNodeList(Node contextNode,
String expression)
throws JRException
- Description copied from interface:
JRXPathExecuter
- Selects a node list by evaluating an XPath expression on a context node.
- Specified by:
selectNodeList in interface JRXPathExecuter- Overrides:
selectNodeList in class JaxenXPathExecuter
- 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 Object selectObject(Node contextNode,
String expression)
throws JRException
- Description copied from interface:
JRXPathExecuter
- Selects 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 a
java.lang.String, java.lang.Number or java.lang.Boolean.
- Specified by:
selectObject in interface JRXPathExecuter- Overrides:
selectObject in class JaxenXPathExecuter
- 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(String expression)
addNamespaceContext
protected void addNamespaceContext(Node contextNode,
org.jaxen.XPath xPath,
String expression)
throws JRException
- Throws:
JRException
Copyright © 2012. All Rights Reserved.