getElementText() and nextTag() APIs in a
way that is agnostic from the rest of the XMLEventReader implementation. Both will use the subclasses
internalNextEvent() as the exclusive way to read events.
Note, copied from the uPortal project by permission of author. See
https://github.com/Jasig/uPortal/blob/master/uportal-war/src/main/java/org/jasig/portal/xml/stream/BaseXMLEventReader.java
| Modifier and Type | Field and Description |
|---|---|
| private XMLEvent |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public final String | getElementText()
Overrides javax. Implements javax. |
| protected final XMLEvent | |
| protected abstract XMLEvent | |
| public final Object | next()
Overrides javax. Implements java. |
| public final XMLEvent | nextEvent()
Overrides javax. Implements javax. |
| public final XMLEvent | nextTag()
Overrides javax. Implements javax. |
| previousEvent | back to summary |
|---|---|
| private XMLEvent previousEvent | |
| BaseXMLEventReader | back to summary |
|---|---|
| public BaseXMLEventReader(XMLEventReader reader) | |
| getElementText | back to summary |
|---|---|
| public final String getElementText() throws XMLStreamException Overrides javax. Implements javax. Doc from javax. Reads the content of a text-only element. Precondition: the current event is START_ELEMENT. Postcondition: The current event is the corresponding END_ELEMENT.
| |
| getPreviousEvent | back to summary |
|---|---|
protected final XMLEvent getPreviousEvent()
| |
| internalNextEvent | back to summary |
|---|---|
| protected abstract XMLEvent internalNextEvent() throws XMLStreamException Subclass's version of | |
| next | back to summary |
|---|---|
| public final Object next() Overrides javax. Implements java. Doc from java. Returns the next element in the iteration. | |
| nextEvent | back to summary |
|---|---|
| public final XMLEvent nextEvent() throws XMLStreamException Overrides javax. Implements javax. Doc from javax. Gets the next XMLEvent. The initial event is
| |
| nextTag | back to summary |
|---|---|
| public final XMLEvent nextTag() throws XMLStreamException Overrides javax. Implements javax. Doc from javax. Skips any insignificant space events until a START_ELEMENT or END_ELEMENT is reached. If anything other than space characters are encountered, an exception is thrown. This method should be used when processing element-only content because the parser is not able to recognize ignorable whitespace if the DTD is missing or not interpreted.
| |