public interface NormalizedNodeStreamWriter extends Closeable, Flushable
container
- Container node representation, start event is
emitted using #startContainerNode(NodeIdentifier, int)
and node end event is
emitted using endNode()
. Container node is implementing
the org.opendaylight.yangtools.yang.binding.DataObject interface.
list
- YANG list statement has two representation in event
stream - unkeyed list and map. Unkeyed list is YANG list which did not
specify key.
Map
- Map start event is emitted using
#startMapNode(NodeIdentifier, int)
and is ended using endNode()
. Each map
entry start is emitted using #startMapEntryNode(NodeIdentifierWithPredicates, int)
with Map of keys
and finished using endNode()
.UnkeyedList
- Unkeyed list represent list without keys,
unkeyed list start is emitted using #startUnkeyedList(NodeIdentifier, int)
list
end is emitted using endNode()
. Each list item is emitted using
#startUnkeyedListItem(NodeIdentifier, int)
and ended using endNode()
.leaf
- Leaf node event is emitted using
#leafNode(NodeIdentifier, Object)
. endNode()
MUST NOT BE emitted for
leaf node.leaf-list
- Leaf list start is emitted using
#startLeafSet(NodeIdentifier, int)
. Leaf list end is emitted using
endNode()
. Leaf list entries are emmited using
leafSetEntryNode(QName, Object)
.
anyxml - AN node event is emitted using
#leafNode(NodeIdentifier, Object)
. endNode()
MUST NOT BE emitted
for anyxml node.
choice
Choice node event is emmited by
#startChoiceNode(NodeIdentifier, int)
event and
finished by invoking endNode()
augment
- Represents augmentation, augmentation node is started
by invoking #startAugmentationNode(AugmentationIdentifier)
and
finished by invoking endNode()
.Implementations of this interface must not hold user suppled objects and resources needlessly.
Modifier and Type | Field and Description |
---|---|
static int |
UNKNOWN_SIZE
Methods in this interface allow users to hint the underlying
implementation about the sizing of container-like constructors
(leafLists, containers, etc.).
|
Modifier and Type | Method and Description |
---|---|
void |
anyxmlNode(YangInstanceIdentifier.NodeIdentifier name,
Object value)
Emits anyxml node event.
|
void |
close() |
void |
endNode()
Emits end event for node.
|
void |
flush() |
void |
leafNode(YangInstanceIdentifier.NodeIdentifier name,
Object value)
Emits a leaf node event with supplied value.
|
void |
leafSetEntryNode(QName name,
Object value)
Emits a leaf set entry node.
|
default void |
nextDataSchemaNode(DataSchemaNode schema)
Attach the specified
DataSchemaNode to the next node which will get started or emitted. |
void |
startAugmentationNode(YangInstanceIdentifier.AugmentationIdentifier identifier)
Emits start of augmentation node.
|
void |
startChoiceNode(YangInstanceIdentifier.NodeIdentifier name,
int childSizeHint)
Emits start of a choice node event.
|
void |
startContainerNode(YangInstanceIdentifier.NodeIdentifier name,
int childSizeHint)
Emits start of new container.
|
void |
startLeafSet(YangInstanceIdentifier.NodeIdentifier name,
int childSizeHint)
Emits a start of leaf set (leaf-list).
|
void |
startMapEntryNode(YangInstanceIdentifier.NodeIdentifierWithPredicates identifier,
int childSizeHint)
Emits start of map entry.
|
void |
startMapNode(YangInstanceIdentifier.NodeIdentifier name,
int childSizeHint)
Emits start of map node event.
|
void |
startOrderedLeafSet(YangInstanceIdentifier.NodeIdentifier name,
int childSizeHint)
Emits a start of leaf set (leaf-list).
|
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 |
startYangModeledAnyXmlNode(YangInstanceIdentifier.NodeIdentifier name,
int childSizeHint)
Emits start of new yang modeled anyXml node.
|
static final int UNKNOWN_SIZE
The acceptable hint values are non-negative integers and this constant, all other values will result, based on implementation preference, in the hint being completely ignored or IllegalArgumentException being thrown.
void leafNode(YangInstanceIdentifier.NodeIdentifier name, Object value) throws IOException
name
- name of node as defined in schema, namespace and revision are
derived from parent node.value
- Value of leaf node. vIllegalArgumentException
- If emitted leaf node has invalid value in current context or
was emitted multiple times.IllegalStateException
- If node was emitted inside map
,
choice
unkeyed list
node.IOException
- if an underlying IO error occursvoid startLeafSet(YangInstanceIdentifier.NodeIdentifier name, int childSizeHint) throws IOException
Emits start of leaf set, during writing leaf set event, only
leafSetEntryNode(QName, Object)
calls are valid. Leaf set event is
finished by calling endNode()
.
name
- 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
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.IllegalArgumentException
- If emitted leaf node is invalid in current context or was
emitted multiple times.IllegalStateException
- If node was emitted inside map
,
choice
unkeyed list
node.IOException
- if an underlying IO error occursvoid startOrderedLeafSet(YangInstanceIdentifier.NodeIdentifier name, int childSizeHint) throws IOException
Emits start of leaf set, during writing leaf set event, only
leafSetEntryNode(QName, Object)
calls are valid. Leaf set event is
finished by calling endNode()
.
name
- 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
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.IllegalArgumentException
- If emitted leaf node is invalid in current context or was
emitted multiple times.IllegalStateException
- If node was emitted inside map
,
choice
unkeyed list
node.IOException
- if an underlying IO error occursvoid leafSetEntryNode(QName name, Object value) throws IOException
name
- name of the node as defined in the schema.value
- Value of leaf set entry node. Supplied object MUST BE constant over time.IllegalArgumentException
- If emitted leaf node has invalid value.IllegalStateException
- If node was emitted outside leaf set
node.IOException
- if an underlying IO error occursvoid startContainerNode(YangInstanceIdentifier.NodeIdentifier name, int childSizeHint) throws IOException
End of container event is emitted by invoking endNode()
.
Valid sub-events are:
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)
name
- 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
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.IllegalArgumentException
- If emitted node is invalid in current context or was emitted
multiple times.IllegalStateException
- If node was emitted inside map
,
choice
unkeyed list
node.IOException
- if an underlying IO error occursvoid startUnkeyedList(YangInstanceIdentifier.NodeIdentifier name, int childSizeHint) throws IOException
End of unkeyed list event is emitted by invoking endNode()
.
Valid subevents is only #startUnkeyedListItem(NodeIdentifier, int)
. All other
methods will throw IllegalArgumentException
.
name
- 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
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.IllegalArgumentException
- If emitted node is invalid in current context or was emitted
multiple times.IllegalStateException
- If node was emitted inside map
,
choice
unkeyed list
node.IOException
- if an underlying IO error occursvoid startUnkeyedListItem(YangInstanceIdentifier.NodeIdentifier name, int childSizeHint) throws IOException
Unkeyed list item event is finished by invoking endNode()
. Valid
sub-events are:
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)
name
- Identifier of nodechildSizeHint
- Non-negative count of expected direct child nodes or
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.IllegalStateException
- If node was emitted outside unkeyed list
node.IOException
- if an underlying IO error occursvoid startMapNode(YangInstanceIdentifier.NodeIdentifier name, int childSizeHint) throws IOException
End of map node event is emitted by invoking endNode()
. Valid
subevents is only
#startMapEntryNode(NodeIdentifierWithPredicates, int)
. All other
methods will throw IllegalArgumentException
.
name
- 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
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.IllegalArgumentException
- If emitted node is invalid in current context or was emitted
multiple times.IllegalStateException
- If node was emitted inside map
,
choice
unkeyed list
node.IOException
- if an underlying IO error occursvoid startMapEntryNode(YangInstanceIdentifier.NodeIdentifierWithPredicates identifier, int childSizeHint) throws IOException
End of map entry event is emitted by invoking endNode()
.
Valid sub-events are:
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)
identifier
- 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
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.IllegalArgumentException
- If key contains incorrect value.IllegalStateException
- If node was emitted outside map entry
node.IOException
- if an underlying IO error occursvoid startOrderedMapNode(YangInstanceIdentifier.NodeIdentifier name, int childSizeHint) throws IOException
End of map node event is emitted by invoking endNode()
. Valid
subevents is only
#startMapEntryNode(NodeIdentifierWithPredicates, int)
. All other
methods will throw IllegalArgumentException
.
name
- 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
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.IllegalArgumentException
- If emitted node is invalid in current context or was emitted
multiple times.IllegalStateException
- If node was emitted inside map
,
choice
unkeyed list
node.IOException
- if an underlying IO error occursvoid startChoiceNode(YangInstanceIdentifier.NodeIdentifier name, int childSizeHint) throws IOException
name
- 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
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.IllegalArgumentException
- If emitted node is invalid in current context or was emitted
multiple times.IllegalStateException
- If node was emitted inside map
,
choice
unkeyed list
node.IOException
- if an underlying IO error occursvoid startAugmentationNode(YangInstanceIdentifier.AugmentationIdentifier identifier) throws IOException
End of augmentation event is emitted by invoking endNode()
.
Valid sub-events are:
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)
identifier
- Augmentation identifierIllegalArgumentException
- If augmentation is invalid in current context.IOException
- if an underlying IO error occursvoid anyxmlNode(YangInstanceIdentifier.NodeIdentifier name, Object value) throws IOException
name
- name of node as defined in schema, namespace and revision are
derived from parent node.value
- Value of AnyXml node.IllegalArgumentException
- If emitted node is invalid in current context or was emitted
multiple times.IllegalStateException
- If node was emitted inside map
,
choice
unkeyed list
node.IOException
- if an underlying IO error occursvoid startYangModeledAnyXmlNode(YangInstanceIdentifier.NodeIdentifier name, int childSizeHint) throws IOException
End of yang modeled anyXml node event is emitted by invoking endNode()
.
Valid sub-events are:
leafNode(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier, java.lang.Object)
startContainerNode(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier, int)
startLeafSet(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier, int)
startMapNode(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier, int)
startUnkeyedList(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier, int)
name
- 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
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.IllegalArgumentException
- If emitted node is invalid in current context or was emitted
multiple times.IllegalStateException
- If node was emitted inside map
,
choice
unkeyed list
node.IOException
- if an underlying IO error occursvoid endNode() throws IOException
IllegalStateException
- If there is no start* event to be closed.IOException
- if an underlying IO error occursdefault void nextDataSchemaNode(@Nonnull DataSchemaNode schema)
DataSchemaNode
to the next node which will get started or emitted. The default
implementation does nothing.schema
- DataSchemaNodeNullPointerException
- if the argument is nullvoid close() throws IOException
close
in interface AutoCloseable
close
in interface Closeable
IOException
void flush() throws IOException
flush
in interface Flushable
IOException
Copyright © 2019 OpenDaylight. All rights reserved.