Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package eksam2018;
- import java.io.File;
- import java.io.IOException;
- import java.text.SimpleDateFormat;
- import org.codehaus.jackson.map.ObjectMapper;
- import org.codehaus.jackson.map.SerializationConfig;
- /**
- *
- * @author t166038
- */
- public class write {
- public static void write() throws IOException {
- ObjectMapper mapper = new ObjectMapper(); // mapperi maaramine
- mapper.enable(SerializationConfig.Feature.INDENT_OUTPUT); // teksti format
- mapper.setDateFormat(new SimpleDateFormat("dd.MM.yyyy"));
- String FNAME="salegoods.json"; // fail
- mapper.writeValue(new File(FNAME), Eksam2018.saleGoods); // faili sisse kirjutamine
- }
- }
Add Comment
Please, Sign In to add comment