Examples >

Read Big Decimal In JSON

/*
 * Copyright (c) 2006-2019 North Concepts Inc.  All rights reserved.
 * Proprietary and Confidential.  Use is subject to license terms.
 *
 * http://northconcepts.com/data-pipeline/licensing/
 *
 */
package com.northconcepts.datapipeline.examples.cookbook;

import com.northconcepts.datapipeline.core.DataReader;
import com.northconcepts.datapipeline.core.DataWriter;
import com.northconcepts.datapipeline.core.StreamWriter;
import com.northconcepts.datapipeline.job.Job;
import com.northconcepts.datapipeline.json.JsonRecordReader;

import java.io.File;

public class ReadBigDecimalInJSON {

    public static void main(String[] args) {
        DataReader reader = new JsonRecordReader(new File("example/data/output/simple-json-to-file-with-bigdecimal.json"))
                .addRecordBreak("/array/object").setUseBigDecimal(true);
        
        DataWriter writer = StreamWriter.newSystemOutWriter();
        
        Job.run(reader, writer);
    }
}
Mobile Analytics