public final class StaxEventHelper extends Object
Modifier and Type | Class and Description |
---|---|
static class |
StaxEventHelper.EventPredicates
EventPredicates related helper functions.
|
Modifier and Type | Method and Description |
---|---|
static void |
loop(XMLEventReader reader,
Predicate<XMLEvent> filter,
Predicate<XMLEvent> checker,
EventProcessor processor)
Loops through the elements until the checker returns null or the element stream stops
|
static StartElement |
peekNextElement(XMLEventReader reader,
QName name)
Peek next element matching the QName
|
static StartElement |
peekNextElement(XMLEventReader reader,
Set<QName> names)
Peek next element which mathces any QNames from the set provided
|
public static StartElement peekNextElement(XMLEventReader reader, QName name) throws XMLStreamException
reader
- the readername
- the nameXMLStreamException
- the xML stream exceptionpublic static StartElement peekNextElement(XMLEventReader reader, Set<QName> names) throws XMLStreamException
reader
- the readernames
- the namesXMLStreamException
- the xML stream exceptionpublic static void loop(XMLEventReader reader, Predicate<XMLEvent> filter, Predicate<XMLEvent> checker, EventProcessor processor) throws XMLStreamException
reader
- the readerfilter
- the filter says whether the element has to be processed or not.checker
- the checkerprocessor
- the processorXMLStreamException
- the xML stream exceptionCopyright © 2010–2024 The DAISY Consortium. All rights reserved.