BUG-7983: unify JSONCodec and XmlCodec methods
[yangtools.git] / yang / yang-data-codec-gson / src / main / java / org / opendaylight / yangtools / yang / data / codec / gson / QuotedJSONCodec.java
index 30ab141736b12a5219e72ed08ba9520c84cb40a5..6d3a107fd06d0f43a70616770bd0468db44f2479 100644 (file)
@@ -9,7 +9,7 @@ package org.opendaylight.yangtools.yang.data.codec.gson;
 
 import com.google.gson.stream.JsonWriter;
 import java.io.IOException;
-import org.opendaylight.yangtools.concepts.Codec;
+import org.opendaylight.yangtools.yang.data.impl.codec.DataStringCodec;
 
 /**
  * A {@link JSONCodec} which needs double quotes in output representation.
@@ -17,18 +17,12 @@ import org.opendaylight.yangtools.concepts.Codec;
  * @param <T> Deserialized value type
  */
 final class QuotedJSONCodec<T> extends AbstractJSONCodec<T> {
-    QuotedJSONCodec(final Codec<String, T> codec) {
+    QuotedJSONCodec(final DataStringCodec<T> codec) {
         super(codec);
     }
 
-    /**
-     * Serialize specified value with specified JsonWriter.
-     *
-     * @param writer JsonWriter
-     * @param value
-     */
     @Override
-    public void serializeToWriter(JsonWriter writer, T value) throws IOException {
-        writer.value(serialize(value));
+    public void writeValue(final JsonWriter ctx, final T value) throws IOException {
+        ctx.value(serialize(value));
     }
 }
\ No newline at end of file