Package org.xwiki.xml.stax
Class StAXUtils
- java.lang.Object
-
- org.xwiki.xml.stax.StAXUtils
-
public final class StAXUtils extends Object
Various tools related to StAX API.- Since:
- 5.2M1
- Version:
- $Id: 646012cb2f4782f7f5f9d88bf6b0cbdf2268f3eb $
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static XMLEventReadergetXMLEventReader(Source source)Extract or create an instance ofXMLEventReaderfrom the providedSource.static XMLStreamReadergetXMLStreamReader(XMLInputFactory factory, Source source)Extract or create an instance ofXMLStreamReaderfrom the providedSource.static XMLStreamReadergetXMLStreamReader(Source source)Extract or create an instance ofXMLStreamReaderfrom the providedSource.static XMLStreamWritergetXMLStreamWriter(XMLOutputFactory factory, Result result)Extract or create an instance ofXMLStreamWriterfrom the providedResult.static XMLStreamWritergetXMLStreamWriter(Result result)Extract or create an instance ofXMLStreamWriterfrom the providedResult.static intskipElement(XMLStreamReader xmlReader)Go to the end of the current element.
-
-
-
Method Detail
-
getXMLStreamReader
public static XMLStreamReader getXMLStreamReader(Source source) throws XMLStreamException
Extract or create an instance ofXMLStreamReaderfrom the providedSource.- Parameters:
source- the source- Returns:
- the
XMLStreamReader - Throws:
XMLStreamException- when failing to extract xml stream reader
-
getXMLStreamReader
public static XMLStreamReader getXMLStreamReader(XMLInputFactory factory, Source source) throws XMLStreamException
Extract or create an instance ofXMLStreamReaderfrom the providedSource.- Parameters:
factory- theXMLStreamReaderto use (if needed)source- the source- Returns:
- the
XMLStreamReader - Throws:
XMLStreamException- when failing to extract xml stream reader- Since:
- 9.5, 9.6RC1
-
getXMLEventReader
public static XMLEventReader getXMLEventReader(Source source) throws XMLStreamException
Extract or create an instance ofXMLEventReaderfrom the providedSource.- Parameters:
source- the source- Returns:
- the
XMLEventReader - Throws:
XMLStreamException- when failing to extract xml event reader
-
getXMLStreamWriter
public static XMLStreamWriter getXMLStreamWriter(Result result) throws XMLStreamException
Extract or create an instance ofXMLStreamWriterfrom the providedResult.- Parameters:
result- the result- Returns:
- the
XMLStreamWriter - Throws:
XMLStreamException- when failing to extract xml stream writer
-
getXMLStreamWriter
public static XMLStreamWriter getXMLStreamWriter(XMLOutputFactory factory, Result result) throws XMLStreamException
Extract or create an instance ofXMLStreamWriterfrom the providedResult.- Parameters:
factory- theXMLOutputFactoryto use (if needed)result- the result- Returns:
- the
XMLStreamWriter - Throws:
XMLStreamException- when failing to extract xml stream writer- Since:
- 9.5.2, 9.6RC1
-
skipElement
public static int skipElement(XMLStreamReader xmlReader) throws XMLStreamException
Go to the end of the current element. This include skipping any children element.- Parameters:
xmlReader- the XML stream reader- Returns:
- the type of the new current event
- Throws:
XMLStreamException- if there is an error processing the underlying XML source- Since:
- 5.3M1
-
-