public abstract class XMLStreamNormalizedNodeStreamWriter<T> extends Object implements NormalizedNodeStreamAttributeWriter
NormalizedNodeStreamWriter which translates the events into an XMLStreamWriter,
resulting in a RFC 6020 XML encoding. There are 2 versions of this class, one that takes a
SchemaContext and encodes values appropriately according to the yang schema. The other is
schema-less and merely outputs values using toString. The latter is intended for debugging
where doesn't have a SchemaContext available and isn't meant for production use.UNKNOWN_SIZE| Modifier and Type | Method and Description |
|---|---|
void |
close() |
static NormalizedNodeStreamWriter |
create(XMLStreamWriter writer,
SchemaContext context)
Create a new writer with the specified context as its root.
|
static NormalizedNodeStreamWriter |
create(XMLStreamWriter writer,
SchemaContext context,
SchemaPath path)
Create a new writer with the specified context and rooted in the specified schema path
|
static NormalizedNodeStreamWriter |
createSchemaless(XMLStreamWriter writer)
Create a new schema-less writer.
|
void |
endNode()
Emits end event for node.
|
void |
flush() |
void |
startContainerNode(YangInstanceIdentifier.NodeIdentifier name,
int childSizeHint,
Map<QName,String> attributes) |
void |
startMapEntryNode(YangInstanceIdentifier.NodeIdentifierWithPredicates identifier,
int childSizeHint)
Emits start of map entry.
|
void |
startMapEntryNode(YangInstanceIdentifier.NodeIdentifierWithPredicates identifier,
int childSizeHint,
Map<QName,String> attributes) |
void |
startMapNode(YangInstanceIdentifier.NodeIdentifier name,
int childSizeHint)
Emits start of map node event.
|
void |
startOrderedMapNode(YangInstanceIdentifier.NodeIdentifier name,
int childSizeHint)
Emits start of map node event.
|
void |
startUnkeyedList(YangInstanceIdentifier.NodeIdentifier name,
int childSizeHint)
Emits start of unkeyed list node event.
|
void |
startUnkeyedListItem(YangInstanceIdentifier.NodeIdentifier name,
int childSizeHint)
Emits start of new unkeyed list item.
|
void |
startUnkeyedListItem(YangInstanceIdentifier.NodeIdentifier name,
int childSizeHint,
Map<QName,String> attributes) |
void |
startYangModeledAnyXmlNode(YangInstanceIdentifier.NodeIdentifier name,
int childSizeHint,
Map<QName,String> attributes) |
static String |
toString(Element xml) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitleafNode, leafSetEntryNodeanyxmlNode, leafNode, leafSetEntryNode, nextDataSchemaNode, startAugmentationNode, startChoiceNode, startContainerNode, startLeafSet, startOrderedLeafSet, startYangModeledAnyXmlNodepublic static NormalizedNodeStreamWriter create(XMLStreamWriter writer, SchemaContext context)
writer - Output XMLStreamWritercontext - Associated SchemaContext.NormalizedNodeStreamWriterpublic static NormalizedNodeStreamWriter create(XMLStreamWriter writer, SchemaContext context, SchemaPath path)
writer - Output XMLStreamWritercontext - Associated SchemaContext.path - pathNormalizedNodeStreamWriterpublic static NormalizedNodeStreamWriter createSchemaless(XMLStreamWriter writer)
writer - Output XMLStreamWriterNormalizedNodeStreamWriterpublic final void startContainerNode(YangInstanceIdentifier.NodeIdentifier name, int childSizeHint, Map<QName,String> attributes) throws IOException
startContainerNode in interface NormalizedNodeStreamAttributeWriterIOExceptionpublic final void startYangModeledAnyXmlNode(YangInstanceIdentifier.NodeIdentifier name, int childSizeHint, Map<QName,String> attributes) throws IOException
startYangModeledAnyXmlNode in interface NormalizedNodeStreamAttributeWriterIOExceptionpublic final void startUnkeyedListItem(YangInstanceIdentifier.NodeIdentifier name, int childSizeHint, Map<QName,String> attributes) throws IOException
startUnkeyedListItem in interface NormalizedNodeStreamAttributeWriterIOExceptionpublic final void startMapEntryNode(YangInstanceIdentifier.NodeIdentifierWithPredicates identifier, int childSizeHint, Map<QName,String> attributes) throws IOException
startMapEntryNode in interface NormalizedNodeStreamAttributeWriterIOExceptionpublic final void startUnkeyedList(YangInstanceIdentifier.NodeIdentifier name, int childSizeHint)
NormalizedNodeStreamWriter
End of unkeyed list event is emitted by invoking NormalizedNodeStreamWriter.endNode().
Valid subevents is only #startUnkeyedListItem(NodeIdentifier, int). All other
methods will throw IllegalArgumentException.
startUnkeyedList in interface NormalizedNodeStreamWritername - name of node as defined in schema, namespace and revision are
derived from parent node.childSizeHint - Non-negative count of expected direct child nodes or
NormalizedNodeStreamWriter.UNKNOWN_SIZE if count is unknown. This is only hint
and should not fail writing of child events, if there are more
events than count.public final void startUnkeyedListItem(YangInstanceIdentifier.NodeIdentifier name, int childSizeHint) throws IOException
NormalizedNodeStreamWriter
Unkeyed list item event is finished by invoking NormalizedNodeStreamWriter.endNode(). Valid
sub-events are:
NormalizedNodeStreamWriter.leafNode(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier, java.lang.Object)#startContainerNode(NodeIdentifier, int)#startChoiceNode(NodeIdentifier, int)#startLeafSet(NodeIdentifier, int)#startMapNode(NodeIdentifier, int)#startUnkeyedList(NodeIdentifier, int)#startAugmentationNode(AugmentationIdentifier)startUnkeyedListItem in interface NormalizedNodeStreamWritername - Identifier of nodechildSizeHint - Non-negative count of expected direct child nodes or
NormalizedNodeStreamWriter.UNKNOWN_SIZE if count is unknown. This is only hint
and should not fail writing of child events, if there are more
events than count.IOException - if an underlying IO error occurspublic final void startMapNode(YangInstanceIdentifier.NodeIdentifier name, int childSizeHint)
NormalizedNodeStreamWriter
End of map node event is emitted by invoking NormalizedNodeStreamWriter.endNode(). Valid
subevents is only
#startMapEntryNode(NodeIdentifierWithPredicates, int). All other
methods will throw IllegalArgumentException.
startMapNode in interface NormalizedNodeStreamWritername - name of node as defined in schema, namespace and revision are
derived from parent node.childSizeHint - Non-negative count of expected direct child nodes or
NormalizedNodeStreamWriter.UNKNOWN_SIZE if count is unknown. This is only hint
and should not fail writing of child events, if there are more
events than count.public final void startMapEntryNode(YangInstanceIdentifier.NodeIdentifierWithPredicates identifier, int childSizeHint) throws IOException
NormalizedNodeStreamWriter
End of map entry event is emitted by invoking NormalizedNodeStreamWriter.endNode().
Valid sub-events are:
NormalizedNodeStreamWriter.leafNode(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier, java.lang.Object)#startContainerNode(NodeIdentifier, int)#startChoiceNode(NodeIdentifier, int)#startLeafSet(NodeIdentifier, int)#startMapNode(NodeIdentifier, int)#startUnkeyedList(NodeIdentifier, int)#startAugmentationNode(AugmentationIdentifier)startMapEntryNode in interface NormalizedNodeStreamWriteridentifier - QName to value pairs of keys of map entry node. Values MUST BE constant over time.childSizeHint - Non-negative count of expected direct child nodes or
NormalizedNodeStreamWriter.UNKNOWN_SIZE if count is unknown. This is only hint
and should not fail writing of child events, if there are more
events than count.IOException - if an underlying IO error occurspublic final void startOrderedMapNode(YangInstanceIdentifier.NodeIdentifier name, int childSizeHint)
NormalizedNodeStreamWriter
End of map node event is emitted by invoking NormalizedNodeStreamWriter.endNode(). Valid
subevents is only
#startMapEntryNode(NodeIdentifierWithPredicates, int). All other
methods will throw IllegalArgumentException.
startOrderedMapNode in interface NormalizedNodeStreamWritername - name of node as defined in schema, namespace and revision are
derived from parent node.childSizeHint - Non-negative count of expected direct child nodes or
NormalizedNodeStreamWriter.UNKNOWN_SIZE if count is unknown. This is only hint
and should not fail writing of child events, if there are more
events than count.public final void endNode()
throws IOException
NormalizedNodeStreamWriterendNode in interface NormalizedNodeStreamWriterIOException - if an underlying IO error occurspublic final void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in interface NormalizedNodeStreamWriterIOExceptionpublic final void flush()
throws IOException
flush in interface Flushableflush in interface NormalizedNodeStreamWriterIOExceptionCopyright © 2018 OpenDaylight. All rights reserved.