From 51e8f27a20bdc7ca28b6bd28ff8f67f6ae6ebc48 Mon Sep 17 00:00:00 2001 From: Gian-Andrea Hutter Date: Fri, 28 Oct 2022 12:24:55 +0200 Subject: [PATCH] #17 implementation objectmapper writeFile --- .../zhaw/gartenverwaltung/gardenplan/Gardenplanmodel.java | 8 ++++++++ .../ch/zhaw/gartenverwaltung/io/JsonTaskDatabase.java | 4 +++- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 src/main/java/ch/zhaw/gartenverwaltung/gardenplan/Gardenplanmodel.java diff --git a/src/main/java/ch/zhaw/gartenverwaltung/gardenplan/Gardenplanmodel.java b/src/main/java/ch/zhaw/gartenverwaltung/gardenplan/Gardenplanmodel.java new file mode 100644 index 0000000..24757bd --- /dev/null +++ b/src/main/java/ch/zhaw/gartenverwaltung/gardenplan/Gardenplanmodel.java @@ -0,0 +1,8 @@ +package ch.zhaw.gartenverwaltung.gardenplan; + +public class Gardenplanmodel { +// private JasonGardenplan gardenplan; + // liste von crops + //task generieren + //plant holen, task template mit tasktemplateklasse tasks erstellen +} diff --git a/src/main/java/ch/zhaw/gartenverwaltung/io/JsonTaskDatabase.java b/src/main/java/ch/zhaw/gartenverwaltung/io/JsonTaskDatabase.java index a460f2f..e16a74d 100644 --- a/src/main/java/ch/zhaw/gartenverwaltung/io/JsonTaskDatabase.java +++ b/src/main/java/ch/zhaw/gartenverwaltung/io/JsonTaskDatabase.java @@ -2,6 +2,7 @@ package ch.zhaw.gartenverwaltung.io; import ch.zhaw.gartenverwaltung.types.Task; import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.datatype.jdk8.Jdk8Module; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer; @@ -95,7 +96,8 @@ public class JsonTaskDatabase implements TaskDatabase{ */ private void writeTaskListToFile() throws IOException { ObjectMapper mapper = new ObjectMapper(); - mapper.registerModule(timeModule); + mapper.registerModule(timeModule) + .registerModule(new Jdk8Module()); if(dataSource != null) { mapper.writeValue(new File(dataSource.getFile()), taskMap);