diff options
Diffstat (limited to 'plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/messages/DispoAnnotationListMessageWriter.java')
-rw-r--r-- | plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/messages/DispoAnnotationListMessageWriter.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/messages/DispoAnnotationListMessageWriter.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/messages/DispoAnnotationListMessageWriter.java index b7665cc1dba..ad2e214970d 100644 --- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/messages/DispoAnnotationListMessageWriter.java +++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/messages/DispoAnnotationListMessageWriter.java @@ -24,13 +24,18 @@ import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MultivaluedMap; import javax.ws.rs.ext.MessageBodyWriter; import org.eclipse.osee.disposition.model.DispoAnnotationData; -import org.eclipse.osee.framework.core.util.JsonUtil; import org.eclipse.osee.framework.jdk.core.util.Strings; +import org.eclipse.osee.jaxrs.JaxRsApi; /** * @author Angel Avila */ public class DispoAnnotationListMessageWriter implements MessageBodyWriter<List<DispoAnnotationData>> { + private final JaxRsApi jaxRsApi; + + public DispoAnnotationListMessageWriter(JaxRsApi jaxRsApi) { + this.jaxRsApi = jaxRsApi; + } @Override public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) { @@ -48,7 +53,7 @@ public class DispoAnnotationListMessageWriter implements MessageBodyWriter<List< @Override public void writeTo(List<DispoAnnotationData> dispoAnnotations, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException, WebApplicationException { - String jsonString = JsonUtil.toJson(dispoAnnotations); + String jsonString = jaxRsApi.toJson(dispoAnnotations); entityStream.write(jsonString.getBytes(Strings.UTF_8)); } -} +}
\ No newline at end of file |