org.xwiki.xml.stax
Class StAXUtils

java.lang.Object
  extended by org.xwiki.xml.stax.StAXUtils

public final class StAXUtils
extends Object

Various tools related to StAX API.

Since:
5.2M1
Version:
$Id: 4e71b93f4cb33c16270d52c9ca94bd90008f0b57 $

Method Summary
static XMLEventReader getXMLEventReader(Source source)
          Extract or create an instance of XMLEventReader from the provided Source.
static XMLStreamReader getXMLStreamReader(Source source)
          Extract or create an instance of XMLStreamReader from the provided Source.
static XMLStreamWriter getXMLStreamWriter(Result result)
          Extract or create an instance of XMLStreamWriter from the provided Result.
static int skipElement(XMLStreamReader xmlReader)
          Go to the end of the current element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getXMLStreamReader

public static XMLStreamReader getXMLStreamReader(Source source)
                                          throws XMLStreamException
Extract or create an instance of XMLStreamReader from the provided Source.

Parameters:
source - the source
Returns:
the XMLStreamReader
Throws:
XMLStreamException - when failing to extract xml stream reader

getXMLEventReader

public static XMLEventReader getXMLEventReader(Source source)
                                        throws XMLStreamException
Extract or create an instance of XMLEventReader from the provided Source.

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 of XMLStreamWriter from the provided Result.

Parameters:
result - the result
Returns:
the XMLStreamWriter
Throws:
XMLStreamException - when failing to extract xml stream writer

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


Copyright © 2004-2013 XWiki. All Rights Reserved.