@Test public void testJsonMarshalling() { JacksonJsonObjectMarshaller<Foo> jsonObjectMarshaller = new JacksonJsonObjectMarshaller<>(); String foo = jsonObjectMarshaller.marshal(new Foo(1, "foo")); Assert.assertEquals("{\"id\":1,\"name\":\"foo\"}", foo); }
@Override public String marshal(T item) { try { return objectMapper.writeValueAsString(item); } catch (JsonProcessingException e) { throw new ItemStreamException("Unable to marshal object " + item + " to Json", e); } }
JacksonJsonObjectMarshaller implements JsonObjectMarshaller<T> { @Override public String marshal(T item) { try { return objectMapper.writeValueAsString(item); } catch (JsonProcessingException e) { throw new ItemStreamException("Unable to marshal object " + item + " to Json", e); } } }
JacksonJsonObjectMarshaller implements JsonObjectMarshaller<T> { @Override public String marshal(T item) { try { return objectMapper.writeValueAsString(item); } catch (JsonProcessingException e) { throw new ItemStreamException("Unable to marshal object " + item + " to Json", e); } }  }
JacksonJsonObjectMarshaller implements JsonObjectMarshaller<T> { @Override public String marshal(T item) { try { return objectMapper.writeValueAsString(item); } catch (JsonProcessingException e) { throw new ItemStreamException("Unable to marshal object " + item + " to Json", e); } }  void setObjectMapper(ObjectMapper objectMapper); @Override String marshal(T item); }
JacksonJsonObjectMarshaller implements JsonObjectMarshaller<T> { @Override public String marshal(T item) { try { return objectMapper.writeValueAsString(item); } catch (JsonProcessingException e) { throw new ItemStreamException("Unable to marshal object " + item + " to Json", e); } }  void setObjectMapper(ObjectMapper objectMapper); @Override String marshal(T item);  }