Class UntrustedXML
- java.lang.Object
-
- org.opendaylight.yangtools.util.xml.UntrustedXML
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static @NonNull XMLStreamReader
createXMLStreamReader(InputStream stream)
Create a newXMLStreamReader
for dealing with untrusted XML data.static @NonNull XMLStreamReader
createXMLStreamReader(InputStream stream, Charset charset)
Create a newXMLStreamReader
for dealing with untrusted XML data.static @NonNull XMLStreamReader
createXMLStreamReader(Reader reader)
Create a newXMLStreamReader
for dealing with untrusted XML data.static @NonNull DocumentBuilder
newDocumentBuilder()
Create a newDocumentBuilder
for dealing with untrusted XML data.static @NonNull SAXParser
newSAXParser()
Create a newSAXParser
for dealing with untrusted XML data.
-
-
-
Method Detail
-
newDocumentBuilder
public static @NonNull DocumentBuilder newDocumentBuilder()
Create a newDocumentBuilder
for dealing with untrusted XML data. This method is equivalent toDocumentBuilderFactory.newDocumentBuilder()
, except it does not throw a checked exception.- Returns:
- A new DocumentBuilder
- Throws:
UnsupportedOperationException
- if the runtime fails to instantiate a good enough builder
-
newSAXParser
public static @NonNull SAXParser newSAXParser()
Create a newSAXParser
for dealing with untrusted XML data. This method is equivalent toSAXParserFactory.newSAXParser()
, except it does not throw a checked exception.- Returns:
- A new SAXParser
- Throws:
UnsupportedOperationException
- if the runtime fails to instantiate a good enough builder
-
createXMLStreamReader
public static @NonNull XMLStreamReader createXMLStreamReader(InputStream stream) throws XMLStreamException
Create a newXMLStreamReader
for dealing with untrusted XML data. This method is equivalent toXMLInputFactory.createXMLStreamReader(InputStream)
.- Returns:
- A new XMLStreamReader
- Throws:
XMLStreamException
- when the underlying factory throws it
-
createXMLStreamReader
public static @NonNull XMLStreamReader createXMLStreamReader(InputStream stream, Charset charset) throws XMLStreamException
Create a newXMLStreamReader
for dealing with untrusted XML data. This method is equivalent toXMLInputFactory.createXMLStreamReader(InputStream, String)
, except it takes an explict charset argument.- Returns:
- A new XMLStreamReader
- Throws:
XMLStreamException
- when the underlying factory throws it
-
createXMLStreamReader
public static @NonNull XMLStreamReader createXMLStreamReader(Reader reader) throws XMLStreamException
Create a newXMLStreamReader
for dealing with untrusted XML data. This method is equivalent toXMLInputFactory.createXMLStreamReader(Reader)
.- Returns:
- A new XMLStreamReader
- Throws:
XMLStreamException
- when the underlying factory throws it
-
-