org.knime.core.data.xml.io
Class LimitedXPathMatcher

java.lang.Object
  extended by org.knime.core.data.xml.io.LimitedXPathMatcher

public class LimitedXPathMatcher
extends Object

Author:
Heiko Hofer

Constructor Summary
LimitedXPathMatcher(String xpath, NamespaceContext nsContext)
          Create a new instance.
 
Method Summary
(package private)  void endElement()
          Called in the XMLStreamConstants.START_ELEMENT call back of the XMLStreamReader.
 boolean nodeMatches()
          Returns true when the xpath matches any node except the root node.
 boolean rootMatches()
          Returns true when the xpath matches the root node '/'.
(package private)  boolean startElement(QName name)
          Called in the XMLStreamConstants.START_ELEMENT call back of the XMLStreamReader.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LimitedXPathMatcher

public LimitedXPathMatcher(String xpath,
                           NamespaceContext nsContext)
                    throws InvalidSettingsException
Create a new instance.

Parameters:
xpath - The limited xpath which may contain absolute paths to nodes and the |-Operator
nsContext - The namespace context used for the XPath
Throws:
InvalidSettingsException - when the xpath has prefixes not defined in the nsContext
Method Detail

startElement

boolean startElement(QName name)
Called in the XMLStreamConstants.START_ELEMENT call back of the XMLStreamReader. Returns this element matches the xpath expression given in the constructor.

Parameters:
name - name of the element
Returns:
true when element matches the xpath

endElement

void endElement()
Called in the XMLStreamConstants.START_ELEMENT call back of the XMLStreamReader.


rootMatches

public boolean rootMatches()
Returns true when the xpath matches the root node '/'.

Returns:
true when the xpath matches the root node '/'

nodeMatches

public boolean nodeMatches()
Returns true when the xpath matches any node except the root node.

Returns:
true when the xpath matches any node except the root node.


Copyright, 2003 - 2012. All rights reserved.
University of Konstanz, Germany.
Chair for Bioinformatics and Information Mining, Prof. Dr. Michael R. Berthold.
You may not modify, publish, transmit, transfer or sell, reproduce, create derivative works from, distribute, perform, display, or in any way exploit any of the content, in whole or in part, except as otherwise expressly permitted in writing by the copyright owner or as specified in the license file distributed with this product.