SMILA 1.0 API documentation

org.eclipse.smila.utils.xml.stax
Class SimpleTagExtractor

java.lang.Object
  extended by org.eclipse.smila.utils.xml.stax.SimpleTagExtractor

public class SimpleTagExtractor
extends java.lang.Object

Extracts the contents of specific tags from an XML stream.


Constructor Summary
SimpleTagExtractor(boolean removeTags)
          Creates a new instance.
 
Method Summary
 java.util.List<java.lang.String> getTags(java.lang.String tagName, java.io.InputStream inputStream)
          Reads all tags with the given name from the given XML stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleTagExtractor

public SimpleTagExtractor(boolean removeTags)
Creates a new instance.

Parameters:
removeTags - true to return the contents of the only, without the surrounding tags
Method Detail

getTags

public java.util.List<java.lang.String> getTags(java.lang.String tagName,
                                                java.io.InputStream inputStream)
                                         throws javax.xml.stream.XMLStreamException
Reads all tags with the given name from the given XML stream. The namespace of the tags is ignored.

Parameters:
tagName - the name of the tag
inputStream - contains the XML document
Returns:
the contents of all tags with the given local name
Throws:
javax.xml.stream.XMLStreamException - if the stream did not contain a valid XML document

SMILA 1.0 API documentation