@Beta public final class BindingToNormalizedStreamWriter extends Object implements BindingStreamEventWriter, org.opendaylight.yangtools.concepts.Delegator<org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter>
UNKNOWN_SIZE
Modifier and Type | Method and Description |
---|---|
void |
anyxmlNode(String name,
Object value)
Emits anyxml node event.
|
void |
close() |
static BindingToNormalizedStreamWriter |
create(NodeCodecContext<?> schema,
org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter delegate)
Create instance of Binding v2 representation writer.
|
void |
endNode()
Emits end event for node.
|
void |
flush() |
org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter |
getDelegate() |
void |
leafNode(String localName,
Object value)
Emits a leaf node event with supplied value.
|
void |
leafSetEntryNode(Object value)
Emits a leaf set entry node
|
void |
startAnydataNode(String name,
Object value)
Emits anydata node event.
|
void |
startAugmentationNode(Class<? extends Augmentation<?>> augmentationType)
Emits start of augmentation node.
|
void |
startCase(Class<? extends TreeNode> caze,
int childSizeHint)
Starts a case node.
|
<T extends TreeNode> |
startChoiceNode(Item<T> choice,
int childSizeHint)
Emits start of choice node.
|
void |
startContainerNode(Class<? extends TreeNode> object,
int childSizeHint)
Emits start of new container.
|
void |
startLeafSet(String localName,
int childSizeHint)
Emits a start of leaf set (leaf-list).
|
<I extends TreeNode,T> |
startMapEntryNode(IdentifiableItem<I,T> keyValues,
int childSizeHint)
Emits start of map entry.
|
<T extends TreeNode & org.opendaylight.yangtools.concepts.Identifiable<?>> |
startMapNode(Class<T> mapEntryType,
int childSizeHint)
Emits start of unordered map node event.
|
void |
startOrderedLeafSet(String localName,
int childSizeHint)
Emits a start of leaf set (leaf-list).
|
<T extends TreeNode & org.opendaylight.yangtools.concepts.Identifiable<?>> |
startOrderedMapNode(Class<T> mapEntryType,
int childSizeHint)
Emits start of ordered map node event.
|
void |
startUnkeyedList(Class<? extends TreeNode> localName,
int childSizeHint)
Emits start of unkeyed list node event.
|
void |
startUnkeyedListItem(int childSizeHint)
Emits start of new unkeyed list item.
|
public static BindingToNormalizedStreamWriter create(NodeCodecContext<?> schema, org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter delegate)
schema
- - codec schemadelegate
- - DOM writer delegatorpublic org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter getDelegate()
getDelegate
in interface org.opendaylight.yangtools.concepts.Delegator<org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter>
public void endNode() throws IOException
BindingStreamEventWriter
endNode
in interface BindingStreamEventWriter
IOException
- if an underlying IO error occurspublic void leafNode(String localName, Object value) throws IOException
BindingStreamEventWriter
leafNode
in interface BindingStreamEventWriter
localName
- name of node as defined in schema, namespace and revision are
derived from parent node.value
- Value of leaf node.IOException
- if an underlying IO error occurspublic void anyxmlNode(String name, Object value) throws IOException
BindingStreamEventWriter
anyxmlNode
in interface BindingStreamEventWriter
IOException
- if an underlying IO error occurspublic void leafSetEntryNode(Object value) throws IOException
BindingStreamEventWriter
leafSetEntryNode
in interface BindingStreamEventWriter
value
- Value of leaf set entry node.IOException
- if an underlying IO error occurspublic void startAugmentationNode(Class<? extends Augmentation<?>> augmentationType) throws IOException
BindingStreamEventWriter
End of augmentation event is emitted by invoking BindingStreamEventWriter.endNode()
.
Valid sub-events are:
BindingStreamEventWriter.leafNode(String, Object)
BindingStreamEventWriter.startContainerNode(Class, int)
BindingStreamEventWriter.startChoiceNode(Item, int)
BindingStreamEventWriter.startLeafSet(String, int)
BindingStreamEventWriter.startMapNode(Class, int)
BindingStreamEventWriter.startUnkeyedList(Class, int)
Note this is only method, which does not require childSizeHint, since
maximum value is always size of possibleChildren
.
startAugmentationNode
in interface BindingStreamEventWriter
augmentationType
- augmentation classIOException
- if an underlying IO error occurspublic void startCase(Class<? extends TreeNode> caze, int childSizeHint)
BindingStreamEventWriter
Valid sub-events are:
BindingStreamEventWriter.leafNode(String, Object)
BindingStreamEventWriter.startContainerNode(Class, int)
BindingStreamEventWriter.startChoiceNode(Item, int)
BindingStreamEventWriter.startLeafSet(String, int)
BindingStreamEventWriter.startMapNode(Class, int)
BindingStreamEventWriter.startUnkeyedList(Class, int)
BindingStreamEventWriter.startAugmentationNode(Class)
startCase
in interface BindingStreamEventWriter
caze
- Case classpublic <T extends TreeNode> void startChoiceNode(Item<T> choice, int childSizeHint) throws IOException
BindingStreamEventWriter
Valid sub-event is BindingStreamEventWriter.startCase(Class, int)
, which selects case
which should be written.
startChoiceNode
in interface BindingStreamEventWriter
choice
- Choice class.childSizeHint
- Non-negative count of expected direct child nodes or
BindingStreamEventWriter.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 void startContainerNode(Class<? extends TreeNode> object, int childSizeHint) throws IOException
BindingStreamEventWriter
End of container event is emitted by invoking BindingStreamEventWriter.endNode()
.
Valid sub-events are:
BindingStreamEventWriter.leafNode(String, Object)
BindingStreamEventWriter.startContainerNode(Class, int)
BindingStreamEventWriter.startChoiceNode(Item, int)
BindingStreamEventWriter.startLeafSet(String, int)
BindingStreamEventWriter.startMapNode(Class, int)
BindingStreamEventWriter.startUnkeyedList(Class, int)
BindingStreamEventWriter.startAugmentationNode(Class)
startContainerNode
in interface BindingStreamEventWriter
object
- 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
BindingStreamEventWriter.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 void startLeafSet(String localName, int childSizeHint) throws IOException
BindingStreamEventWriter
Emits start of leaf set, during writing leaf set event, only
BindingStreamEventWriter.leafSetEntryNode(Object)
calls are valid. Leaf set event is
finished by calling BindingStreamEventWriter.endNode()
.
startLeafSet
in interface BindingStreamEventWriter
localName
- 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
BindingStreamEventWriter.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 void startOrderedLeafSet(String localName, int childSizeHint) throws IOException
BindingStreamEventWriter
Emits start of leaf set, during writing leaf set event, only
BindingStreamEventWriter.leafSetEntryNode(Object)
calls are valid. Leaf set event is
finished by calling BindingStreamEventWriter.endNode()
.
startOrderedLeafSet
in interface BindingStreamEventWriter
localName
- 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
BindingStreamEventWriter.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 <I extends TreeNode,T> void startMapEntryNode(IdentifiableItem<I,T> keyValues, int childSizeHint) throws IOException
BindingStreamEventWriter
End of map entry event is emitted by invoking BindingStreamEventWriter.endNode()
.
Valid sub-events are:
BindingStreamEventWriter.leafNode(String, Object)
BindingStreamEventWriter.startContainerNode(Class, int)
BindingStreamEventWriter.startChoiceNode(Item, int)
BindingStreamEventWriter.startLeafSet(String, int)
BindingStreamEventWriter.startMapNode(Class, int)
BindingStreamEventWriter.startUnkeyedList(Class, int)
BindingStreamEventWriter.startAugmentationNode(Class)
startMapEntryNode
in interface BindingStreamEventWriter
keyValues
- Key of map entry nodechildSizeHint
- Non-negative count of expected direct child nodes or
BindingStreamEventWriter.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 <T extends TreeNode & org.opendaylight.yangtools.concepts.Identifiable<?>> void startMapNode(Class<T> mapEntryType, int childSizeHint) throws IOException
BindingStreamEventWriter
End of map node event is emitted by invoking BindingStreamEventWriter.endNode()
. Valid
subevents is only BindingStreamEventWriter.startMapEntryNode(IdentifiableItem, int)
. All other methods will
throw IllegalArgumentException
.
startMapNode
in interface BindingStreamEventWriter
mapEntryType
- Class of list.childSizeHint
- Non-negative count of expected direct child nodes or
BindingStreamEventWriter.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 <T extends TreeNode & org.opendaylight.yangtools.concepts.Identifiable<?>> void startOrderedMapNode(Class<T> mapEntryType, int childSizeHint) throws IOException
BindingStreamEventWriter
End of map node event is emitted by invoking BindingStreamEventWriter.endNode()
. Valid
sub-event is only BindingStreamEventWriter.startMapEntryNode(IdentifiableItem, int)
. All other methods will
throw IllegalArgumentException
.
startOrderedMapNode
in interface BindingStreamEventWriter
mapEntryType
- Class of list item, which has defined key.childSizeHint
- Non-negative count of expected direct child nodes or
BindingStreamEventWriter.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 void startUnkeyedList(Class<? extends TreeNode> localName, int childSizeHint) throws IOException
BindingStreamEventWriter
End of unkeyed list event is emitted by invoking BindingStreamEventWriter.endNode()
.
Valid sub-event is only BindingStreamEventWriter.startUnkeyedListItem(int)
. All other
methods will throw IllegalArgumentException
.
startUnkeyedList
in interface BindingStreamEventWriter
localName
- 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
BindingStreamEventWriter.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 void startUnkeyedListItem(int childSizeHint) throws IOException
BindingStreamEventWriter
Un-keyed list item event is finished by invoking BindingStreamEventWriter.endNode()
.
Valid sub-events are:
BindingStreamEventWriter.leafNode(String, Object)
BindingStreamEventWriter.startContainerNode(Class, int)
BindingStreamEventWriter.startChoiceNode(Item, int)
BindingStreamEventWriter.startLeafSet(String, int)
BindingStreamEventWriter.startMapNode(Class, int)
BindingStreamEventWriter.startUnkeyedList(Class, int)
BindingStreamEventWriter.startAugmentationNode(Class)
startUnkeyedListItem
in interface BindingStreamEventWriter
childSizeHint
- Non-negative count of expected direct child nodes or
BindingStreamEventWriter.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 void flush() throws IOException
flush
in interface Flushable
flush
in interface BindingStreamEventWriter
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in interface BindingStreamEventWriter
IOException
public void startAnydataNode(String name, Object value) throws IOException
BindingStreamEventWriter
startAnydataNode
in interface BindingStreamEventWriter
IOException
- if an underlying IO error occursCopyright © 2019 OpenDaylight. All rights reserved.