public class StreamHelper extends Object
Constructor and Description |
---|
StreamHelper() |
Modifier and Type | Method and Description |
---|---|
static void |
checkNextStartTag(XMLStreamReader streamReader,
QName expected)
Check the next start tag is as expected.
|
static boolean |
checkParentFinished(XMLStreamReader streamReader)
Check to see if the parent element is finished.
|
static void |
checkTag(XMLStreamReader streamReader,
QName expected)
Compare the element tag with the expected qualified name.
|
static void |
skipToNextStartElement(XMLStreamReader streamReader)
Make sure the stream is at the start of the next element.
|
static void |
skipToStartElement(XMLStreamReader streamReader)
Make sure the stream is at the start of an element.
|
static void |
writeAttribute(XMLStreamWriter out,
QName attributeName,
Object attributeValue)
Write the attribute to the stream.
|
static void |
writeAttribute(XMLStreamWriter out,
QName attributeName,
QName attributeValue)
Write the attribute to the stream.
|
static void |
writeAttribute(XMLStreamWriter out,
QName attributeName,
String attributeValue)
Write the attribute to the stream.
|
static void |
writeAttributes(XMLStreamWriter out,
Map attributes)
Write the attributes to the stream.
|
static void |
writeEndElement(XMLStreamWriter out,
String prefix,
String namespaceURI)
Write an end element removing the namespace binding if necessary
|
static void |
writeNamespace(XMLStreamWriter out,
String prefix,
String namespaceURI)
Write the namespace if necessary.
|
static void |
writeQualifiedName(XMLStreamWriter out,
QName qName)
Write the QName to the stream as text.
|
static String |
writeStartElement(XMLStreamWriter out,
QName elementName)
Write a start element with appropriate namespace declarations if necessary
|
public static String writeStartElement(XMLStreamWriter out, QName elementName) throws XMLStreamException
out
- The output stream.elementName
- The element name.XMLStreamException
- for errors during writing.public static void writeEndElement(XMLStreamWriter out, String prefix, String namespaceURI) throws XMLStreamException
out
- The output stream.prefix
- The element prefix.namespaceURI
- The previous binding for the prefix.XMLStreamException
- for errors during writing.public static void writeAttributes(XMLStreamWriter out, Map attributes) throws XMLStreamException
out
- The output stream.attributes
- The attributes.XMLStreamException
- Thrown for errors during writing.public static void writeAttribute(XMLStreamWriter out, QName attributeName, Object attributeValue) throws XMLStreamException
out
- The output stream.attributeName
- The attribute name.attributeValue
- The attribute value.XMLStreamException
- Thrown for errors during writing.public static void writeAttribute(XMLStreamWriter out, QName attributeName, QName attributeValue) throws XMLStreamException
out
- The output stream.attributeName
- The attribute name.attributeValue
- The attribute value as a QName.XMLStreamException
- Thrown for errors during writing.public static void writeAttribute(XMLStreamWriter out, QName attributeName, String attributeValue) throws XMLStreamException
out
- The output stream.attributeName
- The attribute name.attributeValue
- The attribute value.XMLStreamException
- Thrown for errors during writing.public static void writeQualifiedName(XMLStreamWriter out, QName qName) throws XMLStreamException
out
- The output stream.qName
- The qualified name.XMLStreamException
- Thrown for errors during writing.public static void writeNamespace(XMLStreamWriter out, String prefix, String namespaceURI) throws XMLStreamException
out
- The output stream.prefix
- The namespace prefix.namespaceURI
- The namespaceURI.XMLStreamException
- Thrown for errors during writing.public static void skipToNextStartElement(XMLStreamReader streamReader) throws XMLStreamException
streamReader
- The current stream reader.XMLStreamException
- For parsing errors.public static void skipToStartElement(XMLStreamReader streamReader) throws XMLStreamException
streamReader
- The current stream reader.XMLStreamException
- For parsing errors.public static void checkNextStartTag(XMLStreamReader streamReader, QName expected) throws XMLStreamException
streamReader
- The stream reader.expected
- The expected qualified name.XMLStreamException
- For errors during parsing.public static void checkTag(XMLStreamReader streamReader, QName expected) throws XMLStreamException
streamReader
- The current stream reader.expected
- The expected qualified name.XMLStreamException
- For errors during parsing.public static boolean checkParentFinished(XMLStreamReader streamReader) throws XMLStreamException
streamReader
- The stream reader.XMLStreamException
- For errors during parsing.Copyright © 2018 JBoss by Red Hat. All rights reserved.