public class WritingMapper extends Object
ObjectMapper
that writes JSON documents to an OutputStream
This class is a simple wrapper for ObjectMapper
and
OutputStream
.
Constructor and Description |
---|
WritingMapper() |
WritingMapper(com.fasterxml.jackson.databind.ObjectMapper mapper,
OutputStream os)
Creates a
WritingMapper |
Modifier and Type | Method and Description |
---|---|
void |
writeValue(Object value)
Serializes a Java value as a JSON output, streaming it to the specified
OutputStream |
public WritingMapper(com.fasterxml.jackson.databind.ObjectMapper mapper, OutputStream os)
WritingMapper
mapper
- the ObjectMapper
to use for writing JSON documentsos
- the target OutputStream
public WritingMapper()
public void writeValue(Object value) throws IOException
OutputStream
value
- the Java value to be serializedIOException
- if the underlying
ObjectMapper.writeValue(OutputStream, Object)
throws an
IOException
Copyright © 2015–2016 Hobrasoft s.r.o.. All rights reserved.