Class JSONNormalizedNodeStreamWriter
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable,org.opendaylight.yangtools.concepts.ExtensibleObject<org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter,,org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriterExtension> org.opendaylight.yangtools.concepts.ObjectExtension<org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter,,org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriterExtension> org.opendaylight.yangtools.rfc8528.data.api.StreamWriterMountPointExtension,org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter,org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriterExtension
Values of leaf and leaf-list are NOT translated according to codecs.
-
Field Summary
Fields inherited from interface org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter
UNKNOWN_SIZE -
Method Summary
Modifier and TypeMethodDescriptionstatic org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWritercreateExclusiveWriter(JSONCodecFactory codecFactory, com.google.gson.stream.JsonWriter jsonWriter) Create a new stream writer, which writes to the specified output stream.static org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWritercreateExclusiveWriter(JSONCodecFactory codecFactory, com.google.gson.stream.JsonWriter jsonWriter, @Nullable org.opendaylight.yangtools.yang.common.XMLNamespace initialNs) Create a new stream writer, which writes to the specified output stream.static org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWritercreateExclusiveWriter(JSONCodecFactory codecFactory, org.opendaylight.yangtools.yang.model.api.EffectiveStatementInference rootNode, org.opendaylight.yangtools.yang.common.XMLNamespace initialNs, com.google.gson.stream.JsonWriter jsonWriter) Create a new stream writer, which writes to the specified output stream.static org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWritercreateExclusiveWriter(JSONCodecFactory codecFactory, org.opendaylight.yangtools.yang.model.api.SchemaPath path, org.opendaylight.yangtools.yang.common.XMLNamespace initialNs, com.google.gson.stream.JsonWriter jsonWriter) Deprecated, for removal: This API element is subject to removal in a future version.Use one of the alternative overloadsstatic org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWritercreateExclusiveWriter(JSONCodecFactory codecFactory, org.opendaylight.yangtools.yang.model.api.stmt.SchemaNodeIdentifier.Absolute path, org.opendaylight.yangtools.yang.common.XMLNamespace initialNs, com.google.gson.stream.JsonWriter jsonWriter) Create a new stream writer, which writes to the specified output stream.static org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWritercreateNestedWriter(JSONCodecFactory codecFactory, com.google.gson.stream.JsonWriter jsonWriter) Create a new stream writer, which writes to the specified output stream.static org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWritercreateNestedWriter(JSONCodecFactory codecFactory, com.google.gson.stream.JsonWriter jsonWriter, @Nullable org.opendaylight.yangtools.yang.common.XMLNamespace initialNs) Create a new stream writer, which writes to the specified output stream.static org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWritercreateNestedWriter(JSONCodecFactory codecFactory, org.opendaylight.yangtools.yang.model.api.EffectiveStatementInference rootNode, org.opendaylight.yangtools.yang.common.XMLNamespace initialNs, com.google.gson.stream.JsonWriter jsonWriter) Create a new stream writer, which writes to the specified output stream.static org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWritercreateNestedWriter(JSONCodecFactory codecFactory, org.opendaylight.yangtools.yang.model.api.SchemaPath path, org.opendaylight.yangtools.yang.common.XMLNamespace initialNs, com.google.gson.stream.JsonWriter jsonWriter) Deprecated, for removal: This API element is subject to removal in a future version.Use one of the alternative overloadsstatic org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWritercreateNestedWriter(JSONCodecFactory codecFactory, org.opendaylight.yangtools.yang.model.api.stmt.SchemaNodeIdentifier.Absolute path, org.opendaylight.yangtools.yang.common.XMLNamespace initialNs, com.google.gson.stream.JsonWriter jsonWriter) Create a new stream writer, which writes to the specified output stream.voiddomSourceValue(DOMSource value) final voidendNode()final voidflush()com.google.common.collect.ClassToInstanceMap<org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriterExtension>voidscalarValue(Object value) final booleanstartAnydataNode(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier name, Class<?> objectModel) final booleanstartAnyxmlNode(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier name, Class<?> objectModel) final voidstartAugmentationNode(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.AugmentationIdentifier identifier) final voidstartChoiceNode(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier name, int childSizeHint) final voidstartContainerNode(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier name, int childSizeHint) voidstartLeafNode(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier name) final voidstartLeafSet(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier name, int childSizeHint) voidstartLeafSetEntryNode(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeWithValue<?> name) final voidstartMapEntryNode(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates identifier, int childSizeHint) final voidstartMapNode(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier name, int childSizeHint) final org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriterstartMountPoint(org.opendaylight.yangtools.rfc8528.data.api.MountPointIdentifier mountId, org.opendaylight.yangtools.rfc8528.data.api.MountPointContext mountCtx) final voidstartOrderedLeafSet(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier name, int childSizeHint) final voidstartOrderedMapNode(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier name, int childSizeHint) final voidstartUnkeyedList(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier name, int childSizeHint) final voidstartUnkeyedListItem(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier name, int childSizeHint) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter
close, nextDataSchemaNode
-
Method Details
-
createExclusiveWriter
public static org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter createExclusiveWriter(JSONCodecFactory codecFactory, com.google.gson.stream.JsonWriter jsonWriter) Create a new stream writer, which writes to the specified output stream.The codec factory can be reused between multiple writers.
Returned writer is exclusive user of JsonWriter, which means it will start top-level JSON element and ends it.
This instance of writer can be used only to emit one top level element, otherwise it will produce incorrect JSON. Closing this instance will close the writer too.
- Parameters:
codecFactory- JSON codec factoryjsonWriter- JsonWriter- Returns:
- A stream writer instance
-
createExclusiveWriter
public static org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter createExclusiveWriter(JSONCodecFactory codecFactory, com.google.gson.stream.JsonWriter jsonWriter, @Nullable org.opendaylight.yangtools.yang.common.XMLNamespace initialNs) Create a new stream writer, which writes to the specified output stream.The codec factory can be reused between multiple writers.
Returned writer is exclusive user of JsonWriter, which means it will start top-level JSON element and ends it.
This instance of writer can be used only to emit one top level element, otherwise it will produce incorrect JSON. Closing this instance will close the writer too.
- Parameters:
codecFactory- JSON codec factoryjsonWriter- JsonWriterinitialNs- Initial namespace, can be null- Returns:
- A stream writer instance
-
createExclusiveWriter
@Deprecated(since="9.0.1", forRemoval=true) public static org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter createExclusiveWriter(JSONCodecFactory codecFactory, org.opendaylight.yangtools.yang.model.api.SchemaPath path, org.opendaylight.yangtools.yang.common.XMLNamespace initialNs, com.google.gson.stream.JsonWriter jsonWriter) Deprecated, for removal: This API element is subject to removal in a future version.Use one of the alternative overloadsCreate a new stream writer, which writes to the specified output stream.The codec factory can be reused between multiple writers.
Returned writer is exclusive user of JsonWriter, which means it will start top-level JSON element and ends it.
This instance of writer can be used only to emit one top level element, otherwise it will produce incorrect JSON. Closing this instance will close the writer too.
- Parameters:
codecFactory- JSON codec factorypath- Schema PathinitialNs- Initial namespacejsonWriter- JsonWriter- Returns:
- A stream writer instance
-
createExclusiveWriter
public static org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter createExclusiveWriter(JSONCodecFactory codecFactory, org.opendaylight.yangtools.yang.model.api.EffectiveStatementInference rootNode, org.opendaylight.yangtools.yang.common.XMLNamespace initialNs, com.google.gson.stream.JsonWriter jsonWriter) Create a new stream writer, which writes to the specified output stream.The codec factory can be reused between multiple writers.
Returned writer is exclusive user of JsonWriter, which means it will start top-level JSON element and ends it.
This instance of writer can be used only to emit one top level element, otherwise it will produce incorrect JSON. Closing this instance will close the writer too.
- Parameters:
codecFactory- JSON codec factoryrootNode- Root node inferenceinitialNs- Initial namespacejsonWriter- JsonWriter- Returns:
- A stream writer instance
-
createExclusiveWriter
public static org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter createExclusiveWriter(JSONCodecFactory codecFactory, org.opendaylight.yangtools.yang.model.api.stmt.SchemaNodeIdentifier.Absolute path, org.opendaylight.yangtools.yang.common.XMLNamespace initialNs, com.google.gson.stream.JsonWriter jsonWriter) Create a new stream writer, which writes to the specified output stream.The codec factory can be reused between multiple writers.
Returned writer is exclusive user of JsonWriter, which means it will start top-level JSON element and ends it.
This instance of writer can be used only to emit one top level element, otherwise it will produce incorrect JSON. Closing this instance will close the writer too.
- Parameters:
codecFactory- JSON codec factorypath- Schema PathinitialNs- Initial namespacejsonWriter- JsonWriter- Returns:
- A stream writer instance
-
createNestedWriter
public static org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter createNestedWriter(JSONCodecFactory codecFactory, com.google.gson.stream.JsonWriter jsonWriter) Create a new stream writer, which writes to the specified output stream.The codec factory can be reused between multiple writers.
Returned writer can be used emit multiple top level element, but does not start / close parent JSON object, which must be done by user providing
jsonWriterinstance in order for JSON to be valid. Closing this instance will not close the wrapped writer; the caller must take care of that.- Parameters:
codecFactory- JSON codec factoryjsonWriter- JsonWriter- Returns:
- A stream writer instance
-
createNestedWriter
public static org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter createNestedWriter(JSONCodecFactory codecFactory, com.google.gson.stream.JsonWriter jsonWriter, @Nullable org.opendaylight.yangtools.yang.common.XMLNamespace initialNs) Create a new stream writer, which writes to the specified output stream.The codec factory can be reused between multiple writers.
Returned writer can be used emit multiple top level element, but does not start / close parent JSON object, which must be done by user providing
jsonWriterinstance in order for JSON to be valid. Closing this instance will not close the wrapped writer; the caller must take care of that.- Parameters:
codecFactory- JSON codec factoryinitialNs- Initial namespacejsonWriter- JsonWriter- Returns:
- A stream writer instance
-
createNestedWriter
@Deprecated(since="9.0.1", forRemoval=true) public static org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter createNestedWriter(JSONCodecFactory codecFactory, org.opendaylight.yangtools.yang.model.api.SchemaPath path, org.opendaylight.yangtools.yang.common.XMLNamespace initialNs, com.google.gson.stream.JsonWriter jsonWriter) Deprecated, for removal: This API element is subject to removal in a future version.Use one of the alternative overloadsCreate a new stream writer, which writes to the specified output stream.The codec factory can be reused between multiple writers.
Returned writer can be used emit multiple top level element, but does not start / close parent JSON object, which must be done by user providing
jsonWriterinstance in order for JSON to be valid. Closing this instance will not close the wrapped writer; the caller must take care of that.- Parameters:
codecFactory- JSON codec factorypath- Schema PathinitialNs- Initial namespacejsonWriter- JsonWriter- Returns:
- A stream writer instance
-
createNestedWriter
public static org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter createNestedWriter(JSONCodecFactory codecFactory, org.opendaylight.yangtools.yang.model.api.stmt.SchemaNodeIdentifier.Absolute path, org.opendaylight.yangtools.yang.common.XMLNamespace initialNs, com.google.gson.stream.JsonWriter jsonWriter) Create a new stream writer, which writes to the specified output stream.The codec factory can be reused between multiple writers.
Returned writer can be used emit multiple top level element, but does not start / close parent JSON object, which must be done by user providing
jsonWriterinstance in order for JSON to be valid. Closing this instance will not close the wrapped writer; the caller must take care of that.- Parameters:
codecFactory- JSON codec factorypath- Schema PathinitialNs- Initial namespacejsonWriter- JsonWriter- Returns:
- A stream writer instance
-
createNestedWriter
public static org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter createNestedWriter(JSONCodecFactory codecFactory, org.opendaylight.yangtools.yang.model.api.EffectiveStatementInference rootNode, org.opendaylight.yangtools.yang.common.XMLNamespace initialNs, com.google.gson.stream.JsonWriter jsonWriter) Create a new stream writer, which writes to the specified output stream.The codec factory can be reused between multiple writers.
Returned writer can be used emit multiple top level element, but does not start / close parent JSON object, which must be done by user providing
jsonWriterinstance in order for JSON to be valid. Closing this instance will not close the wrapped writer; the caller must take care of that.- Parameters:
codecFactory- JSON codec factoryrootNode- Root node inferenceinitialNs- Initial namespacejsonWriter- JsonWriter- Returns:
- A stream writer instance
-
getExtensions
public com.google.common.collect.ClassToInstanceMap<org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriterExtension> getExtensions()- Specified by:
getExtensionsin interfaceorg.opendaylight.yangtools.concepts.ExtensibleObject<org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter,org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriterExtension>
-
startLeafNode
public void startLeafNode(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier name) throws IOException - Specified by:
startLeafNodein interfaceorg.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter- Throws:
IOException
-
startLeafSet
public final void startLeafSet(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier name, int childSizeHint) throws IOException - Specified by:
startLeafSetin interfaceorg.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter- Throws:
IOException
-
startLeafSetEntryNode
public void startLeafSetEntryNode(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeWithValue<?> name) throws IOException - Specified by:
startLeafSetEntryNodein interfaceorg.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter- Throws:
IOException
-
startOrderedLeafSet
public final void startOrderedLeafSet(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier name, int childSizeHint) throws IOException - Specified by:
startOrderedLeafSetin interfaceorg.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter- Throws:
IOException
-
startContainerNode
public final void startContainerNode(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier name, int childSizeHint) throws IOException - Specified by:
startContainerNodein interfaceorg.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter- Throws:
IOException
-
startUnkeyedList
public final void startUnkeyedList(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier name, int childSizeHint) throws IOException - Specified by:
startUnkeyedListin interfaceorg.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter- Throws:
IOException
-
startUnkeyedListItem
public final void startUnkeyedListItem(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier name, int childSizeHint) throws IOException - Specified by:
startUnkeyedListItemin interfaceorg.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter- Throws:
IOException
-
startMapNode
public final void startMapNode(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier name, int childSizeHint) throws IOException - Specified by:
startMapNodein interfaceorg.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter- Throws:
IOException
-
startMapEntryNode
public final void startMapEntryNode(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates identifier, int childSizeHint) throws IOException - Specified by:
startMapEntryNodein interfaceorg.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter- Throws:
IOException
-
startOrderedMapNode
public final void startOrderedMapNode(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier name, int childSizeHint) throws IOException - Specified by:
startOrderedMapNodein interfaceorg.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter- Throws:
IOException
-
startChoiceNode
public final void startChoiceNode(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier name, int childSizeHint) - Specified by:
startChoiceNodein interfaceorg.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter
-
startAugmentationNode
public final void startAugmentationNode(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.AugmentationIdentifier identifier) - Specified by:
startAugmentationNodein interfaceorg.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter
-
startAnydataNode
public final boolean startAnydataNode(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier name, Class<?> objectModel) throws IOException - Specified by:
startAnydataNodein interfaceorg.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter- Throws:
IOException
-
startMountPoint
public final org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter startMountPoint(org.opendaylight.yangtools.rfc8528.data.api.MountPointIdentifier mountId, org.opendaylight.yangtools.rfc8528.data.api.MountPointContext mountCtx) throws IOException - Specified by:
startMountPointin interfaceorg.opendaylight.yangtools.rfc8528.data.api.StreamWriterMountPointExtension- Throws:
IOException
-
startAnyxmlNode
public final boolean startAnyxmlNode(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier name, Class<?> objectModel) throws IOException - Specified by:
startAnyxmlNodein interfaceorg.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter- Throws:
IOException
-
endNode
- Specified by:
endNodein interfaceorg.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter- Throws:
IOException
-
flush
- Specified by:
flushin interfaceFlushable- Specified by:
flushin interfaceorg.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter- Throws:
IOException
-
scalarValue
- Specified by:
scalarValuein interfaceorg.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter- Throws:
IOException
-
domSourceValue
- Specified by:
domSourceValuein interfaceorg.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter- Throws:
IOException
-