public abstract class QNameTransformingStreamWriter extends com.google.common.collect.ForwardingObject implements NormalizedNodeStreamWriter
transform(QName)
function.UNKNOWN_SIZE
Constructor and Description |
---|
QNameTransformingStreamWriter() |
Modifier and Type | Method and Description |
---|---|
void |
anyxmlNode(YangInstanceIdentifier.NodeIdentifier name,
Object value)
Emits anyxml node event.
|
void |
close() |
static NormalizedNodeStreamWriter |
createQNameModuleReplacing(NormalizedNodeStreamWriter delegate,
Map<QNameModule,QNameModule> mapping)
Returns decorator, which uses supplied map to transform QNameModules.
|
static NormalizedNodeStreamWriter |
createQNameReplacing(NormalizedNodeStreamWriter delegate,
Map<QName,QName> mapping)
Returns decorator, which uses supplied map to transform QNames.
|
protected abstract NormalizedNodeStreamWriter |
delegate() |
void |
endNode()
Emits end event for node.
|
void |
flush() |
static NormalizedNodeStreamWriter |
fromFunction(NormalizedNodeStreamWriter delegate,
com.google.common.base.Function<QName,QName> transformation)
Returns decorator, which uses supplied function to transform QNames.
|
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
|
void |
startAugmentationNode(YangInstanceIdentifier.AugmentationIdentifier identifier)
Emits start of augmentation node.
|
void |
startChoiceNode(YangInstanceIdentifier.NodeIdentifier name,
int childSizeHint) |
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.
|
protected abstract QName |
transform(QName key)
Transforms a QName to new mapping.
|
protected abstract NormalizedNodeStreamWriter delegate()
delegate
in class com.google.common.collect.ForwardingObject
public static NormalizedNodeStreamWriter fromFunction(NormalizedNodeStreamWriter delegate, com.google.common.base.Function<QName,QName> transformation)
delegate
- Underlying normalized node stream writertransformation
- Transformation function, function is required to return non-null
values.public static NormalizedNodeStreamWriter createQNameReplacing(NormalizedNodeStreamWriter delegate, Map<QName,QName> mapping)
delegate
- Underlying normalized node stream writermapping
- Immutable map which represent mapping from original to new values.public static NormalizedNodeStreamWriter createQNameModuleReplacing(NormalizedNodeStreamWriter delegate, Map<QNameModule,QNameModule> mapping)
delegate
- Underlying normalized node stream writermapping
- Immutable map which represent mapping from original to new values.@Nonnull protected abstract QName transform(@Nonnull QName key)
key
- QName to transform.public void leafNode(YangInstanceIdentifier.NodeIdentifier name, Object value) throws IOException, IllegalArgumentException
NormalizedNodeStreamWriter
leafNode
in interface NormalizedNodeStreamWriter
name
- name of node as defined in schema, namespace and revision are
derived from parent node.value
- Value of leaf node. vIOException
- if an underlying IO error occursIllegalArgumentException
- If emitted leaf node has invalid value in current context or
was emitted multiple times.public void startLeafSet(YangInstanceIdentifier.NodeIdentifier name, int childSizeHint) throws IOException, IllegalArgumentException
NormalizedNodeStreamWriter
Emits start of leaf set, during writing leaf set event, only
NormalizedNodeStreamWriter.leafSetEntryNode(QName, Object)
calls are valid. Leaf set event is
finished by calling NormalizedNodeStreamWriter.endNode()
.
startLeafSet
in interface NormalizedNodeStreamWriter
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
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 occursIllegalArgumentException
- If emitted leaf node is invalid in current context or was
emitted multiple times.public void startOrderedLeafSet(YangInstanceIdentifier.NodeIdentifier name, int childSizeHint) throws IOException, IllegalArgumentException
NormalizedNodeStreamWriter
Emits start of leaf set, during writing leaf set event, only
NormalizedNodeStreamWriter.leafSetEntryNode(QName, Object)
calls are valid. Leaf set event is
finished by calling NormalizedNodeStreamWriter.endNode()
.
startOrderedLeafSet
in interface NormalizedNodeStreamWriter
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
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 occursIllegalArgumentException
- If emitted leaf node is invalid in current context or was
emitted multiple times.public void leafSetEntryNode(QName name, Object value) throws IOException, IllegalArgumentException
NormalizedNodeStreamWriter
leafSetEntryNode
in interface NormalizedNodeStreamWriter
name
- name of the node as defined in the schema.value
- Value of leaf set entry node. Supplied object MUST BE constant over time.IOException
- if an underlying IO error occursIllegalArgumentException
- If emitted leaf node has invalid value.public void startContainerNode(YangInstanceIdentifier.NodeIdentifier name, int childSizeHint) throws IOException, IllegalArgumentException
NormalizedNodeStreamWriter
End of container 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)
startContainerNode
in interface NormalizedNodeStreamWriter
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
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 occursIllegalArgumentException
- If emitted node is invalid in current context or was emitted
multiple times.public void startUnkeyedList(YangInstanceIdentifier.NodeIdentifier name, int childSizeHint) throws IOException, IllegalArgumentException
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 NormalizedNodeStreamWriter
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
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 occursIllegalArgumentException
- If emitted node is invalid in current context or was emitted
multiple times.public void startUnkeyedListItem(YangInstanceIdentifier.NodeIdentifier name, int childSizeHint) throws IOException, IllegalStateException
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 NormalizedNodeStreamWriter
name
- 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 occursIllegalStateException
- If node was emitted outside unkeyed list
node.public void startMapNode(YangInstanceIdentifier.NodeIdentifier name, int childSizeHint) throws IOException, IllegalArgumentException
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 NormalizedNodeStreamWriter
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
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 occursIllegalArgumentException
- If emitted node is invalid in current context or was emitted
multiple times.public void startMapEntryNode(YangInstanceIdentifier.NodeIdentifierWithPredicates identifier, int childSizeHint) throws IOException, IllegalArgumentException
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 NormalizedNodeStreamWriter
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
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 occursIllegalArgumentException
- If key contains incorrect value.public void startOrderedMapNode(YangInstanceIdentifier.NodeIdentifier name, int childSizeHint) throws IOException, IllegalArgumentException
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 NormalizedNodeStreamWriter
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
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 occursIllegalArgumentException
- If emitted node is invalid in current context or was emitted
multiple times.public void startChoiceNode(YangInstanceIdentifier.NodeIdentifier name, int childSizeHint) throws IOException, IllegalArgumentException
startChoiceNode
in interface NormalizedNodeStreamWriter
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
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 occursIllegalArgumentException
- If emitted node is invalid in current context or was emitted
multiple times.public void startAugmentationNode(YangInstanceIdentifier.AugmentationIdentifier identifier) throws IOException, IllegalArgumentException
NormalizedNodeStreamWriter
End of augmentation 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
in interface NormalizedNodeStreamWriter
identifier
- Augmentation identifierIOException
- if an underlying IO error occursIllegalArgumentException
- If augmentation is invalid in current context.public void anyxmlNode(YangInstanceIdentifier.NodeIdentifier name, Object value) throws IOException, IllegalArgumentException
NormalizedNodeStreamWriter
anyxmlNode
in interface NormalizedNodeStreamWriter
name
- name of node as defined in schema, namespace and revision are
derived from parent node.value
- Value of AnyXml node.IOException
- if an underlying IO error occursIllegalArgumentException
- If emitted node is invalid in current context or was emitted
multiple times.public void startYangModeledAnyXmlNode(YangInstanceIdentifier.NodeIdentifier name, int childSizeHint) throws IOException, IllegalArgumentException
NormalizedNodeStreamWriter
End of yang modeled anyXml node event is emitted by invoking NormalizedNodeStreamWriter.endNode()
.
Valid sub-events are:
NormalizedNodeStreamWriter.leafNode(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier, java.lang.Object)
NormalizedNodeStreamWriter.startContainerNode(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier, int)
NormalizedNodeStreamWriter.startLeafSet(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier, int)
NormalizedNodeStreamWriter.startMapNode(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier, int)
NormalizedNodeStreamWriter.startUnkeyedList(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier, int)
startYangModeledAnyXmlNode
in interface NormalizedNodeStreamWriter
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
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 occursIllegalArgumentException
- If emitted node is invalid in current context or was emitted
multiple times.public void endNode() throws IOException, IllegalStateException
NormalizedNodeStreamWriter
endNode
in interface NormalizedNodeStreamWriter
IOException
- if an underlying IO error occursIllegalStateException
- If there is no start* event to be closed.public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in interface NormalizedNodeStreamWriter
IOException
public void flush() throws IOException
flush
in interface Flushable
flush
in interface NormalizedNodeStreamWriter
IOException
Copyright © 2017 OpenDaylight. All rights reserved.