From db8502d17d77fd8a1bf5ad99e846f45a59a00479 Mon Sep 17 00:00:00 2001 From: Colin Dixon Date: Thu, 9 Apr 2015 20:36:49 -0400 Subject: [PATCH] Mark JSON writers as @Deprecated Also fixing a few typos. Change-Id: I69bb45e564149de510ce0cbd2ef0c5c700b0b3e4 Signed-off-by: Colin Dixon --- .../gson/JSONNormalizedNodeStreamWriter.java | 50 ++++++++++++++++--- 1 file changed, 43 insertions(+), 7 deletions(-) diff --git a/yang/yang-data-codec-gson/src/main/java/org/opendaylight/yangtools/yang/data/codec/gson/JSONNormalizedNodeStreamWriter.java b/yang/yang-data-codec-gson/src/main/java/org/opendaylight/yangtools/yang/data/codec/gson/JSONNormalizedNodeStreamWriter.java index 6b412d583d..b472e321e7 100644 --- a/yang/yang-data-codec-gson/src/main/java/org/opendaylight/yangtools/yang/data/codec/gson/JSONNormalizedNodeStreamWriter.java +++ b/yang/yang-data-codec-gson/src/main/java/org/opendaylight/yangtools/yang/data/codec/gson/JSONNormalizedNodeStreamWriter.java @@ -53,12 +53,18 @@ public class JSONNormalizedNodeStreamWriter implements NormalizedNodeStreamWrite * Create a new stream writer, which writes to the specified {@link Writer}. * * This instance of writer can be used only to emit one top level element, - * therwise it will produce incorrect JSON. + * otherwise it will produce incorrect JSON. + * + * @deprecated please use + * {@link #createExclusiveWriter(JSONCodecFactory, SchemaPath, URI, JsonWriter)} or + * {@link #createNestedWriter(JSONCodecFactory, SchemaPath, URI, JsonWriter)} as + * appropriate instead. * * @param schemaContext Schema context * @param writer Output writer * @return A stream writer instance */ + @Deprecated public static NormalizedNodeStreamWriter create(final SchemaContext schemaContext, final Writer writer) { return create(schemaContext, SchemaPath.ROOT, null, writer); } @@ -67,13 +73,19 @@ public class JSONNormalizedNodeStreamWriter implements NormalizedNodeStreamWrite * Create a new stream writer, which writes to the specified {@link Writer}. * * This instance of writer can be used only to emit one top level element, - * therwise it will produce incorrect JSON. + * otherwise it will produce incorrect JSON. + * + * @deprecated please use + * {@link #createExclusiveWriter(JSONCodecFactory, SchemaPath, URI, JsonWriter)} or + * {@link #createNestedWriter(JSONCodecFactory, SchemaPath, URI, JsonWriter)} as + * appropriate instead. * * @param schemaContext Schema context * @param path Root schemapath * @param writer Output writer * @return A stream writer instance */ + @Deprecated public static NormalizedNodeStreamWriter create(final SchemaContext schemaContext, final SchemaPath path, final Writer writer) { return create(schemaContext, path, null, writer); } @@ -82,7 +94,12 @@ public class JSONNormalizedNodeStreamWriter implements NormalizedNodeStreamWrite * Create a new stream writer, which writes to the specified {@link Writer}. * * This instance of writer can be used only to emit one top level element, - * therwise it will produce incorrect JSON. + * otherwise it will produce incorrect JSON. + * + * @deprecated please use + * {@link #createExclusiveWriter(JSONCodecFactory, SchemaPath, URI, JsonWriter)} or + * {@link #createNestedWriter(JSONCodecFactory, SchemaPath, URI, JsonWriter)} as + * appropriate instead. * * @param schemaContext Schema context * @param path Root schemapath @@ -90,6 +107,7 @@ public class JSONNormalizedNodeStreamWriter implements NormalizedNodeStreamWrite * @param initialNs Initial namespace * @return A stream writer instance */ + @Deprecated public static NormalizedNodeStreamWriter create(final SchemaContext schemaContext, final SchemaPath path, final URI initialNs, final Writer writer) { return createExclusiveWriter(JSONCodecFactory.create(schemaContext), path, initialNs, JsonWriterFactory.createJsonWriter(writer)); @@ -99,13 +117,19 @@ public class JSONNormalizedNodeStreamWriter implements NormalizedNodeStreamWrite * Create a new stream writer, which writes to the specified output stream. * * This instance of writer can be used only to emit one top level element, - * therwise it will produce incorrect JSON. + * otherwise it will produce incorrect JSON. + * + * @deprecated please use + * {@link #createExclusiveWriter(JSONCodecFactory, SchemaPath, URI, JsonWriter)} or + * {@link #createNestedWriter(JSONCodecFactory, SchemaPath, URI, JsonWriter)} as + * appropriate instead. * * @param schemaContext Schema context * @param writer Output writer * @param indentSize indentation size * @return A stream writer instance */ + @Deprecated public static NormalizedNodeStreamWriter create(final SchemaContext schemaContext, final Writer writer, final int indentSize) { return createExclusiveWriter(JSONCodecFactory.create(schemaContext), SchemaPath.ROOT, null,JsonWriterFactory.createJsonWriter(writer, indentSize)); } @@ -115,13 +139,19 @@ public class JSONNormalizedNodeStreamWriter implements NormalizedNodeStreamWrite * can be reused between multiple writers. * * This instance of writer can be used only to emit one top level element, - * therwise it will produce incorrect JSON. + * otherwise it will produce incorrect JSON. + * + * @deprecated please use + * {@link #createExclusiveWriter(JSONCodecFactory, SchemaPath, URI, JsonWriter)} or + * {@link #createNestedWriter(JSONCodecFactory, SchemaPath, URI, JsonWriter)} as + * appropriate instead. * * @param codecFactory JSON codec factory * @param writer Output writer * @param indentSize indentation size * @return A stream writer instance */ + @Deprecated public static NormalizedNodeStreamWriter create(final JSONCodecFactory codecFactory, final Writer writer, final int indentSize) { return createExclusiveWriter(codecFactory, SchemaPath.ROOT, null, JsonWriterFactory.createJsonWriter(writer,indentSize)); } @@ -130,7 +160,12 @@ public class JSONNormalizedNodeStreamWriter implements NormalizedNodeStreamWrite * Create a new stream writer, which writes to the specified output stream. * * This instance of writer can be used only to emit one top level element, - * therwise it will produce incorrect JSON. + * otherwise it will produce incorrect JSON. + * + * @deprecated please use + * {@link #createExclusiveWriter(JSONCodecFactory, SchemaPath, URI, JsonWriter)} or + * {@link #createNestedWriter(JSONCodecFactory, SchemaPath, URI, JsonWriter)} as + * appropriate instead. * * @param schemaContext Schema context * @param path Schema Path @@ -138,6 +173,7 @@ public class JSONNormalizedNodeStreamWriter implements NormalizedNodeStreamWrite * @param jsonWriter JsonWriter * @return A stream writer instance */ + @Deprecated public static NormalizedNodeStreamWriter create(SchemaContext schemaContext, SchemaPath path, URI initialNs, JsonWriter jsonWriter) { return createExclusiveWriter(JSONCodecFactory.create(schemaContext), path, initialNs, jsonWriter); @@ -152,7 +188,7 @@ public class JSONNormalizedNodeStreamWriter implements NormalizedNodeStreamWrite * top-level JSON element and ends it. * * This instance of writer can be used only to emit one top level element, - * therwise it will produce incorrect JSON. + * otherwise it will produce incorrect JSON. * * @param codecFactory JSON codec factory * @param path Schema Path -- 2.36.6