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 XMLEventReader
getXMLEventReader(Source source)
Extract or create an instance ofXMLEventReader
from the providedSource
.static XMLStreamReader
getXMLStreamReader(XMLInputFactory factory, Source source)
Extract or create an instance ofXMLStreamReader
from the providedSource
.static XMLStreamReader
getXMLStreamReader(Source source)
Extract or create an instance ofXMLStreamReader
from the providedSource
.static XMLStreamWriter
getXMLStreamWriter(XMLOutputFactory factory, Result result)
Extract or create an instance ofXMLStreamWriter
from the providedResult
.static XMLStreamWriter
getXMLStreamWriter(Result result)
Extract or create an instance ofXMLStreamWriter
from the providedResult
.static int
skipElement(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 ofXMLStreamReader
from 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 ofXMLStreamReader
from the providedSource
.- Parameters:
factory
- theXMLStreamReader
to 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 ofXMLEventReader
from 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 ofXMLStreamWriter
from 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 ofXMLStreamWriter
from the providedResult
.- Parameters:
factory
- theXMLOutputFactory
to 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
-
-