public abstract class AbstractStaxBuilder extends Object
Constructor and Description |
---|
AbstractStaxBuilder() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
accept(XMLEvent xmlEvent)
Checks if the given
XMLEvent is a StartElement and if the
corresponding xml tag can be processed based on a tag name. |
protected abstract void |
add(XMLEventReader xmlEventReader,
XMLEvent xmlEvent) |
protected abstract String |
getAcceptableQName() |
boolean |
process(XMLEventReader xmlEventReader,
XMLEvent xmlEvent) |
protected Optional<String> |
readAttribute(StartElement startElement,
QName qName)
Reads a value of an attribute of a given element.
|
protected String |
readSingleElement(XMLEventReader xmlEventReader)
Reads a value between a simple tag element.
|
protected abstract String getAcceptableQName()
protected boolean accept(XMLEvent xmlEvent)
XMLEvent
is a StartElement
and if the
corresponding xml tag can be processed based on a tag name.xmlEvent
- an event to checktrue
if corresponding event can be processed by current builder,
false
otherwisepublic boolean process(XMLEventReader xmlEventReader, XMLEvent xmlEvent)
protected abstract void add(XMLEventReader xmlEventReader, XMLEvent xmlEvent) throws XMLStreamException
XMLStreamException
protected String readSingleElement(XMLEventReader xmlEventReader) throws XMLStreamException
<someTag>some-value</someTag>
will
return some-value
as a string.xmlEventReader
- a current XMLEventReader
XMLStreamException
protected Optional<String> readAttribute(StartElement startElement, QName qName)
startElement
- an element to get an attribute fromqName
- a QName
of an attribute to readOptional.empty()
otherwiseCopyright © 2021 JBoss by Red Hat. All rights reserved.