net.sf.jasperreports.engine.util.xml
Class XalanNsAwareXPathExecuter

java.lang.Object
  extended by net.sf.jasperreports.engine.util.xml.XalanXPathExecuter
      extended by net.sf.jasperreports.engine.util.xml.XalanNsAwareXPathExecuter
All Implemented Interfaces:
JRXPathExecuter

public class XalanNsAwareXPathExecuter
extends XalanXPathExecuter

XPath executer implementation that uses Apache Xalan.

Version:
$Id: XalanNsAwareXPathExecuter.java 4595 2011-09-08 15:55:10Z teodord $
Author:
Narcis Marcu (narcism@users.sourceforge.net)

Constructor Summary
XalanNsAwareXPathExecuter()
          Default constructor.
 
Method Summary
protected  boolean containsPrefixes(java.lang.String expression)
           
protected  void createNamespaceElement(org.w3c.dom.Node contextNode, java.lang.String expression)
           
 java.util.Map<java.lang.String,java.lang.String> extractXmlNamespaces(org.w3c.dom.Node contextNode)
           
 boolean getDetectXmlNamespaces()
           
 java.util.Map<java.lang.String,java.lang.String> getXmlNamespaceMap()
           
 org.w3c.dom.NodeList selectNodeList(org.w3c.dom.Node contextNode, java.lang.String expression)
          Selects a node list by evaluating an XPath expression on a context node.
 java.lang.Object selectObject(org.w3c.dom.Node contextNode, java.lang.String expression)
          Selects an object by evaluating an XPath expression on a context node.
 void setDetectXmlNamespaces(boolean detectXmlNamespaces)
           
 void setXmlNamespaceMap(java.util.Map<java.lang.String,java.lang.String> xmlNamespaceMap)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XalanNsAwareXPathExecuter

public XalanNsAwareXPathExecuter()
Default constructor.

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)

createNamespaceElement

protected void createNamespaceElement(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 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 XalanXPathExecuter
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 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 XalanXPathExecuter
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)

extractXmlNamespaces

public java.util.Map<java.lang.String,java.lang.String> extractXmlNamespaces(org.w3c.dom.Node contextNode)
                                                                      throws JRException
Throws:
JRException


© 2001-2010 Jaspersoft Corporation www.jaspersoft.com