public abstract class QNameTransformingStreamWriter extends ForwardingNormalizedNodeStreamWriter
This class serves as base for Normalized Node Stream Writer decorators with option to transform
QNames by user-implemented transform(QName)
function.
UNKNOWN_SIZE
Constructor and Description |
---|
QNameTransformingStreamWriter() |
Modifier and Type | Method and Description |
---|---|
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.
|
static NormalizedNodeStreamWriter |
fromFunction(NormalizedNodeStreamWriter delegate,
Function<QName,QName> transformation)
Returns decorator, which uses supplied function to transform QNames.
|
void |
startAnyxmlNode(YangInstanceIdentifier.NodeIdentifier name)
Emits a start of anyxml node event.
|
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 |
startLeafNode(YangInstanceIdentifier.NodeIdentifier name)
Emits a start of leaf node event.
|
void |
startLeafSet(YangInstanceIdentifier.NodeIdentifier name,
int childSizeHint)
Emits a start of system-ordered leaf set (leaf-list).
|
void |
startLeafSetEntryNode(YangInstanceIdentifier.NodeWithValue<?> name)
Emits a leaf set entry node.
|
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 a user-ordered 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 @NonNull QName |
transform(@NonNull QName key)
Transforms a QName to new mapping.
|
close, delegate, domSourceValue, endNode, flush, getExtensions, scalarValue
toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
nextDataSchemaNode
public static NormalizedNodeStreamWriter fromFunction(NormalizedNodeStreamWriter delegate, 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.public void startLeafNode(YangInstanceIdentifier.NodeIdentifier name) throws IOException
NormalizedNodeStreamWriter
startLeafNode
in interface NormalizedNodeStreamWriter
startLeafNode
in class ForwardingNormalizedNodeStreamWriter
name
- name of node as defined in schema, namespace and revision are derived from parent node.IOException
- if an underlying IO error occurspublic void startLeafSet(YangInstanceIdentifier.NodeIdentifier name, int childSizeHint) throws IOException
NormalizedNodeStreamWriter
#startLeafSetEntryNode(NodeWithValue)
calls are valid. Implementations are free to reorder entries
within the leaf-list.startLeafSet
in interface NormalizedNodeStreamWriter
startLeafSet
in class ForwardingNormalizedNodeStreamWriter
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 occurspublic void startOrderedLeafSet(YangInstanceIdentifier.NodeIdentifier name, int childSizeHint) throws IOException
NormalizedNodeStreamWriter
#startLeafSetEntryNode(NodeWithValue)
calls are valid. Implementations must retain the same entry order.startOrderedLeafSet
in interface NormalizedNodeStreamWriter
startOrderedLeafSet
in class ForwardingNormalizedNodeStreamWriter
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 occurspublic void startLeafSetEntryNode(YangInstanceIdentifier.NodeWithValue<?> name) throws IOException
NormalizedNodeStreamWriter
startLeafSetEntryNode
in interface NormalizedNodeStreamWriter
startLeafSetEntryNode
in class ForwardingNormalizedNodeStreamWriter
name
- name of the node as defined in the schema.IOException
- if an underlying IO error occurspublic void startContainerNode(YangInstanceIdentifier.NodeIdentifier name, int childSizeHint) throws IOException
NormalizedNodeStreamWriter
NormalizedNodeStreamWriter.startLeafNode(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier)
#startAnyxmlNode(NodeIdentifier)
#startContainerNode(NodeIdentifier, int)
#startChoiceNode(NodeIdentifier, int)
#startLeafSet(NodeIdentifier, int)
#startMapNode(NodeIdentifier, int)
#startUnkeyedList(NodeIdentifier, int)
#startAugmentationNode(AugmentationIdentifier)
startContainerNode
in interface NormalizedNodeStreamWriter
startContainerNode
in class ForwardingNormalizedNodeStreamWriter
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 occurspublic void startUnkeyedList(YangInstanceIdentifier.NodeIdentifier name, int childSizeHint) throws IOException
NormalizedNodeStreamWriter
#startUnkeyedListItem(NodeIdentifier, int)
.startUnkeyedList
in interface NormalizedNodeStreamWriter
startUnkeyedList
in class ForwardingNormalizedNodeStreamWriter
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 occurspublic void startUnkeyedListItem(YangInstanceIdentifier.NodeIdentifier name, int childSizeHint) throws IOException
NormalizedNodeStreamWriter
NormalizedNodeStreamWriter.startLeafNode(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier)
#startContainerNode(NodeIdentifier, int)
#startChoiceNode(NodeIdentifier, int)
#startLeafSet(NodeIdentifier, int)
#startMapNode(NodeIdentifier, int)
#startUnkeyedList(NodeIdentifier, int)
#startAugmentationNode(AugmentationIdentifier)
startUnkeyedListItem
in interface NormalizedNodeStreamWriter
startUnkeyedListItem
in class ForwardingNormalizedNodeStreamWriter
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 occurspublic void startMapNode(YangInstanceIdentifier.NodeIdentifier name, int childSizeHint) throws IOException
NormalizedNodeStreamWriter
#startMapEntryNode(NodeIdentifierWithPredicates, int)
.startMapNode
in interface NormalizedNodeStreamWriter
startMapNode
in class ForwardingNormalizedNodeStreamWriter
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 occurspublic void startMapEntryNode(YangInstanceIdentifier.NodeIdentifierWithPredicates identifier, int childSizeHint) throws IOException
NormalizedNodeStreamWriter
NormalizedNodeStreamWriter.startLeafNode(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier)
#startContainerNode(NodeIdentifier, int)
#startChoiceNode(NodeIdentifier, int)
#startLeafSet(NodeIdentifier, int)
#startMapNode(NodeIdentifier, int)
#startUnkeyedList(NodeIdentifier, int)
#startAugmentationNode(AugmentationIdentifier)
startMapEntryNode
in interface NormalizedNodeStreamWriter
startMapEntryNode
in class ForwardingNormalizedNodeStreamWriter
identifier
- QName to value pairs of keys of map entry 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 occurspublic void startOrderedMapNode(YangInstanceIdentifier.NodeIdentifier name, int childSizeHint) throws IOException
NormalizedNodeStreamWriter
#startMapEntryNode(NodeIdentifierWithPredicates, int)
.startOrderedMapNode
in interface NormalizedNodeStreamWriter
startOrderedMapNode
in class ForwardingNormalizedNodeStreamWriter
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 occurspublic void startChoiceNode(YangInstanceIdentifier.NodeIdentifier name, int childSizeHint) throws IOException
NormalizedNodeStreamWriter
startChoiceNode
in interface NormalizedNodeStreamWriter
startChoiceNode
in class ForwardingNormalizedNodeStreamWriter
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 occurspublic void startAugmentationNode(YangInstanceIdentifier.AugmentationIdentifier identifier) throws IOException
NormalizedNodeStreamWriter
NormalizedNodeStreamWriter.startLeafNode(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier)
#startContainerNode(NodeIdentifier, int)
#startChoiceNode(NodeIdentifier, int)
#startLeafSet(NodeIdentifier, int)
#startMapNode(NodeIdentifier, int)
#startUnkeyedList(NodeIdentifier, int)
startAugmentationNode
in interface NormalizedNodeStreamWriter
startAugmentationNode
in class ForwardingNormalizedNodeStreamWriter
identifier
- Augmentation identifierIOException
- if an underlying IO error occurspublic void startAnyxmlNode(YangInstanceIdentifier.NodeIdentifier name) throws IOException
NormalizedNodeStreamWriter
startAnyxmlNode
in interface NormalizedNodeStreamWriter
startAnyxmlNode
in class ForwardingNormalizedNodeStreamWriter
name
- name of node as defined in schema, namespace and revision are derived from parent node.IOException
- if an underlying IO error occurspublic void startYangModeledAnyXmlNode(YangInstanceIdentifier.NodeIdentifier name, int childSizeHint) throws IOException
NormalizedNodeStreamWriter
NormalizedNodeStreamWriter.startLeafNode(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier)
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
startYangModeledAnyXmlNode
in class ForwardingNormalizedNodeStreamWriter
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 occursCopyright © 2020 OpenDaylight. All rights reserved.