- public void writeTo(StructuredData t, Class<?> type, Type genericType, Annotation[] annotations,
- MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream)
- throws IOException, WebApplicationException {
- JsonWriter writer = new JsonWriter(new OutputStreamWriter(entityStream, "UTF-8"));
+ public void writeTo(final StructuredData t, final Class<?> type, final Type genericType, final Annotation[] annotations,
+ final MediaType mediaType, final MultivaluedMap<String, Object> httpHeaders, final OutputStream entityStream)
+ throws IOException, WebApplicationException {
+ CompositeNode data = t.getData();
+ if (data == null) {
+ throw new RestconfDocumentedException(Response.Status.NOT_FOUND);
+ }
+
+ JsonWriter writer = new JsonWriter(new OutputStreamWriter(entityStream, Charsets.UTF_8));