com.fasterxml.jackson.databind.SequenceWriter Java Examples

The following examples show how to use com.fasterxml.jackson.databind.SequenceWriter. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CSVStreamConnector.java    From syncope with Apache License 2.0 5 votes vote down vote up
public SequenceWriter writer() throws IOException {
    synchronized (this) {
        if (writer == null) {
            writer = new CsvMapper().writerFor(Map.class).with(schemaBuilder.build()).writeValues(out);
        }
    }
    return writer;
}
 
Example #2
Source File: Braindump.java    From pegasus with Apache License 2.0 5 votes vote down vote up
/**
 * Writes out the braindump.txt file for a workflow in the submit directory. The braindump.txt
 * file is used for passing to the tailstatd daemon that monitors the state of execution of the
 * workflow.
 *
 * @param entries the Map containing the entries going into the braindump file.
 * @return the absolute path to the braindump file.txt written in the directory.
 * @throws IOException in case of error while writing out file.
 */
protected File writeOutBraindumpFile(Map<String, String> entries) throws IOException {
    File f = new File(mSubmitFileDir, BRAINDUMP_FILE);
    YAMLMapper mapper = new YAMLMapper();
    mapper.configure(Feature.WRITE_DOC_START_MARKER, false);
    // SPLIT_LINES feature needs to be disabled until Perl code is deprecated.
    mapper.configure(Feature.SPLIT_LINES, false);
    SequenceWriter writer = mapper.writerWithDefaultPrettyPrinter().writeValues(f);
    writer.write(entries);

    return f;
}