Added date serialization specification
This commit is contained in:
parent
7f964ad5d2
commit
2eb8bbb0b9
|
@ -5,6 +5,7 @@ import java.io.InputStream;
|
|||
import java.io.OutputStream;
|
||||
import java.io.Reader;
|
||||
import java.io.Writer;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
|
@ -58,6 +59,12 @@ public abstract class ElementMapper {
|
|||
mapper = new ObjectMapper();
|
||||
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
||||
|
||||
/*
|
||||
* Instructing Jackson to serialize any Date in the defined pattern
|
||||
*/
|
||||
SimpleDateFormat sdf = new SimpleDateFormat(Element.DATETIME_PATTERN);
|
||||
mapper.setDateFormat(sdf);
|
||||
|
||||
knownTypes = new HashMap<>();
|
||||
|
||||
List<Package> packages = new ArrayList<Package>();
|
||||
|
|
Loading…
Reference in New Issue