@Beta @NotThreadSafe public final class XmlParserStream extends Object implements Closeable, Flushable
Modifier and Type | Method and Description |
---|---|
void |
close() |
static XmlParserStream |
create(NormalizedNodeStreamWriter writer,
SchemaContext schemaContext)
Deprecated.
|
static XmlParserStream |
create(NormalizedNodeStreamWriter writer,
SchemaContext schemaContext,
SchemaNode parentNode)
Utility method for use when caching
XmlCodecFactory is not feasible. |
static XmlParserStream |
create(NormalizedNodeStreamWriter writer,
XmlCodecFactory codecs,
SchemaNode parentNode)
Construct a new
XmlParserStream . |
void |
flush() |
XmlParserStream |
parse(XMLStreamReader reader)
This method parses the XML source and emits node events into a NormalizedNodeStreamWriter based on the
YANG-modeled data contained in the XML source.
|
public static XmlParserStream create(NormalizedNodeStreamWriter writer, XmlCodecFactory codecs, SchemaNode parentNode)
XmlParserStream
.writer
- Output writecodecs
- Shared codecsparentNode
- Parent root node@Deprecated public static XmlParserStream create(NormalizedNodeStreamWriter writer, SchemaContext schemaContext)
create(NormalizedNodeStreamWriter, SchemaContext, SchemaNode)
instead.public static XmlParserStream create(NormalizedNodeStreamWriter writer, SchemaContext schemaContext, SchemaNode parentNode)
XmlCodecFactory
is not feasible. Users with high performance
requirements should use create(NormalizedNodeStreamWriter, XmlCodecFactory, SchemaNode)
instead and
maintain a XmlCodecFactory
to match the current SchemaContext
.public XmlParserStream parse(XMLStreamReader reader) throws XMLStreamException, URISyntaxException, IOException, ParserConfigurationException, SAXException
reader
- StAX reader which is to used to walk through the XML sourceXMLStreamException
- if a well-formedness error or an unexpected processing condition occurs while parsing the XMLURISyntaxException
- if the namespace URI of an XML element contains a syntax errorIOException
- if an error occurs while parsing the value of an anyxml nodeParserConfigurationException
- if an error occurs while parsing the value of an anyxml nodeSAXException
- if an error occurs while parsing the value of an anyxml nodepublic void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
public void flush() throws IOException
flush
in interface Flushable
IOException
Copyright © 2018 OpenDaylight. All rights reserved.