com.atlassian.confluence.content.render.xhtml
Class TextExtractingXmlFragmentEventReader

java.lang.Object
  extended by com.atlassian.confluence.content.render.xhtml.ForwardingXmlEventReader
      extended by com.atlassian.confluence.content.render.xhtml.TextExtractingXmlFragmentEventReader
All Implemented Interfaces:
Iterator, XMLEventReader

public class TextExtractingXmlFragmentEventReader
extends ForwardingXmlEventReader

Class wraps another {code}XmlEventReader{code} to extract text from the XML that has been read.


Field Summary
 
Fields inherited from class com.atlassian.confluence.content.render.xhtml.ForwardingXmlEventReader
delegate
 
Constructor Summary
TextExtractingXmlFragmentEventReader(XMLEventReader xmlEventReader)
           
 
Method Summary
 String getText()
          Returns the text with XML entities resolved.
 XMLEvent nextEvent()
           
 
Methods inherited from class com.atlassian.confluence.content.render.xhtml.ForwardingXmlEventReader
close, getElementText, getProperty, hasNext, next, nextTag, peek, remove
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextExtractingXmlFragmentEventReader

public TextExtractingXmlFragmentEventReader(XMLEventReader xmlEventReader)
                                     throws XMLStreamException
Throws:
XMLStreamException
Method Detail

nextEvent

public XMLEvent nextEvent()
                   throws XMLStreamException
Specified by:
nextEvent in interface XMLEventReader
Overrides:
nextEvent in class ForwardingXmlEventReader
Throws:
XMLStreamException

getText

public String getText()
Returns the text with XML entities resolved. If you plan to use this text to produce XML output make sure you use an api (such as Stax or DOM) that will escape any entities again to avoid introducing an XSS exploit.

Returns:
the text.


Copyright © 2003-2011 Atlassian. All Rights Reserved.