package cz.hobrasoft.pdfmu;

import com.fasterxml.jackson.databind.ObjectMapper;
import java.io.IOException;
import java.io.OutputStream;

/**
 *
 * @author <a href="mailto:filip.bartek@hobrasoft.cz">Filip Bartek</a>
 */
public class WritingMapper {

    private final ObjectMapper mapper;
    private final OutputStream os;

    public WritingMapper(ObjectMapper mapper, OutputStream os) {
        this.mapper = mapper;
        this.os = os;
    }

    public void writeValue(Object value) throws IOException {
        mapper.writeValue(os, value);
    }
}

@@ -143,16 +143,200 @@
 %0A%0D%0A/**%0D%0A
+ * An %7B@link ObjectMapper%7D that writes JSON documents to an %7B@link OutputStream%7D%0D%0A *%0D%0A * %3Cp%3E%0D%0A * This class is a simple wrapper for %7B@link ObjectMapper%7D and%0D%0A * %7B@link OutputStream%7D.%0D%0A
  *%0D%0A * @
@@ -526,131 +526,662 @@
     
-public WritingMapper(ObjectMapper mapper, OutputStream os) %7B%0D%0A        this.mapper = mapper;%0D%0A        this.os = os;%0D%0A    %7D%0D%0A
+/**%0D%0A     * Creates a %7B@link WritingMapper%7D%0D%0A     *%0D%0A     * @param mapper the %7B@link ObjectMapper%7D to use for writing JSON documents%0D%0A     * @param os the target %7B@link OutputStream%7D%0D%0A     */%0D%0A    public WritingMapper(ObjectMapper mapper, OutputStream os) %7B%0D%0A        this.mapper = mapper;%0D%0A        this.os = os;%0D%0A    %7D%0D%0A%0D%0A    /**%0D%0A     * Serializes a Java value as a JSON output, streaming it to the specified%0D%0A     * %7B@link OutputStream%7D%0D%0A     *%0D%0A     * @param value the Java value to be serialized%0D%0A     * @throws IOException if the underlying%0D%0A     * %7B@link ObjectMapper#writeValue(OutputStream, Object)%7D throws an%0D%0A     * %7B@link IOException%7D%0D%0A     */
 %0D%0A  

Add documentation