I'm using jackson and I have a problem with the method returning the Object object. This means that different classes can be passed in .json file and I want to parse them to the corresponding object from my project.
@XmlAnyElement (lax = true)
public Object getEntity() {
return this.entity;
}
I always get LinkedHashMap in return since JSON isn't sure what object should it expect.
Is it possible to annotate the method with the list of expected class names?
Is it possible to annotate the method with the list of expected objects that should be returned?