Been using IDMLlib to load IDML files to POJOs, but when I'm trying to serialize the resulting java object to JSON using Jackson JSON, I keep getting into trouble with infinite recursion.
Caused by JsonMappingException: Infinite recursion (StackOverflowError)
(through reference chain:
de.fhcon.idmllib.api.elements.preferences.Preferences["layoutAdjustmentPreference"]
->de.fhcon.idmllib.api.elements.preferences.LayoutAdjustmentPreference["parent"]
... etc
->> 539 | serializeFields in com.fasterxml.jackson.databind.ser.std.BeanSerializerBase
This happens on multiple occations during parsing.
Idml.document -> Document.root -> Idml.document -> Document.root is a similar one.
I'm using Jackson's ObjectMapper to convert POJO to JSON:
Idml idml = new Idml("test.idml");
ObjectMapper mapper = new ObjectMapper();
String JSONstring = mapper.writeValueAsString(idml);
IDMLlib classes are compiled, so I can't make any changes to them.
Anyone knows a way I can still use the java object IDMLlib returns without having to create my own?
EDIT:
There seems to be a number of references to both "root" and "parent" throughout. So basicly what I'm asking is if anyone knows how to be able to serialize the object without modifying it