Refactor pretty printing
[netconf.git] / restconf / restconf-nb / src / main / java / org / opendaylight / restconf / nb / jaxrs / JsonFormattableBody.java
similarity index 72%
rename from restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/jaxrs/JsonReplyBodyWriter.java
rename to restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/jaxrs/JsonFormattableBody.java
index 751ef05768bf2bedc40bb30ff2bd524ee81237cc..b1c5d6155987ce481a8dd09aedeabd3a0904c61b 100644 (file)
@@ -13,13 +13,13 @@ import javax.ws.rs.Produces;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.ext.Provider;
 import org.opendaylight.restconf.api.MediaTypes;
-import org.opendaylight.restconf.server.api.ReplyBody;
+import org.opendaylight.restconf.server.api.FormattableBody;
 
 @Provider
 @Produces({ MediaTypes.APPLICATION_YANG_DATA_JSON, MediaType.APPLICATION_JSON })
-public final class JsonReplyBodyWriter extends ReplyBodyWriter {
+public final class JsonFormattableBody extends FormattableBodyWriter {
     @Override
-    void writeTo(final ReplyBody body, final OutputStream out) throws IOException {
-        body.writeJSON(out);
+    void writeTo(final FormattableBody body, final OutputStream out) throws IOException {
+        body.formatToJSON(out);
     }
 }