Package uk.ac.ebi.utils.xml.stax
Class StaxUtils
java.lang.Object
uk.ac.ebi.utils.xml.stax.StaxUtils
Utilities to manage the Stax parser API.
- Author:
- brandizi
- Date:
- 29 Jul 2020
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
expectNextTag
(XMLStreamReader xmlr, String tag) InvokesXMLStreamReader.nextTag()
and checks that then: we are in aXMLStreamConstants.START_ELEMENT
, the element istag
.static String
readNextTag
(XMLStreamReader xmlr, String tag) InvokesexpectNextTag(XMLStreamReader, String)
and thenXMLStreamReader.getElementText()
.static String
RendersLocation
in a human-readable format, useful in logging and error messages.static String
xmlCoord
(XMLStreamReader xmlr) Wrapper ofXMLStreamReader.getLocation()
.
-
Method Details
-
expectNextTag
InvokesXMLStreamReader.nextTag()
and checks that then: we are in aXMLStreamConstants.START_ELEMENT
, the element istag
.- Throws:
XMLStreamException
-
readNextTag
InvokesexpectNextTag(XMLStreamReader, String)
and thenXMLStreamReader.getElementText()
.- Throws:
XMLStreamException
-
xmlCoord
RendersLocation
in a human-readable format, useful in logging and error messages. -
xmlCoord
Wrapper ofXMLStreamReader.getLocation()
.
-