public final class XMLStreamUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static XMLStreamReader |
createXMLStreamReader(byte[] xmlContent)
Create XML stream reader for byte array
|
static XMLStreamReader |
createXMLStreamReader(InputStream inputStream)
Create XML stream reader for inputStream
|
static XMLStreamReader |
createXMLStreamReader(String xmlContent)
Create XML stream reader for string
|
static Map<String,Map<String,String>> |
getElementContentsAsMap(InputStream inputStream,
String rowName,
String idName)
Convert the XML stream to a map of entries.
|
static String |
getElementText(XMLStreamReader reader)
Get element text.
|
static XMLInputFactory |
getXmlInputFactory()
Build a new XMLInputFactory.
|
static boolean |
isEndTag(XMLStreamReader reader,
String tagLocalName)
Test if reader is on an end tag named tagLocalName.
|
static boolean |
isStartTag(XMLStreamReader reader)
Test if reader is on a start tag.
|
static boolean |
isStartTag(XMLStreamReader reader,
String tagLocalName)
Test if reader is on a start tag named tagLocalName.
|
public static XMLInputFactory getXmlInputFactory()
public static Map<String,Map<String,String>> getElementContentsAsMap(InputStream inputStream, String rowName, String idName) throws IOException
inputStream - xml input streamrowName - xml tag name of entriesidName - xml tag name of entry attribute used as key in the main mapIOException - on errorpublic static boolean isStartTag(XMLStreamReader reader, String tagLocalName)
reader - xml stream readertagLocalName - tag local namepublic static boolean isStartTag(XMLStreamReader reader)
reader - xml stream readerpublic static boolean isEndTag(XMLStreamReader reader, String tagLocalName)
reader - xml stream readertagLocalName - tag local namepublic static XMLStreamReader createXMLStreamReader(byte[] xmlContent) throws XMLStreamException
xmlContent - xml content as byte arrayXMLStreamException - on errorpublic static XMLStreamReader createXMLStreamReader(String xmlContent) throws XMLStreamException
xmlContent - xml content as stringXMLStreamException - on errorpublic static XMLStreamReader createXMLStreamReader(InputStream inputStream) throws XMLStreamException
inputStream - xml content inputStreamXMLStreamException - on errorpublic static String getElementText(XMLStreamReader reader)
reader - stream readerCopyright © 2001–2025 MickaĆ«l Guessant. All rights reserved.