|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.axis2.format.ElementHelper
public class ElementHelper
Utility class with methods to work on OMElement
objects.
NOTICE: The code in this class will be moved to Axiom (or somewhere else). Use with care!
Method Summary | |
---|---|
static java.io.Reader |
getTextAsStream(org.apache.axiom.om.OMElement element,
boolean cache)
Returns a stream representing the concatenation of the text nodes that are children of a given element. |
static void |
writeTextTo(org.apache.axiom.om.OMElement element,
java.io.Writer out,
boolean cache)
Write the content of the text nodes that are children of a given element to a Writer . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static java.io.Reader getTextAsStream(org.apache.axiom.om.OMElement element, boolean cache)
new StringReader(element.getText())The difference is that the stream implementation returned by this method is guaranteed to have constant memory usage and is optimized for performance.
element
- the element to read the text nodes fromcache
- whether to enable caching when accessing the element
OMElement.getText()
public static void writeTextTo(org.apache.axiom.om.OMElement element, java.io.Writer out, boolean cache) throws javax.xml.stream.XMLStreamException, java.io.IOException
Writer
.
If cache
is true, this method has the same effect as the following instruction:
out.write(element.getText())The difference is that this method is guaranteed to have constant memory usage and is optimized for performance.
element
- the element to read the text nodes fromout
- the stream to write the content tocache
- whether to enable caching when accessing the element
javax.xml.stream.XMLStreamException
- if an error occurs when reading from the element
java.io.IOException
- if an error occurs when writing to the streamOMElement.getText()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |