Support @XmlID, @XmlIDREF #2

tatu-at-salesforce opened this Issue Mar 12, 2012 · 2 comments


None yet

2 participants


(note: re-creation of [])

Now that Jackson 2.0 supports Object Identity, with the new '@XmlIdentityInfo' annotation (and all the machinery needed to support it), we could finally tackle these 2 tricky JAXB annotations.


(copying the original description)

Hello, is it possible during serialization to support these annotations to handle unidirectional reference ?
public class Folder {

private String id;

@XmlElement(name = "parentId")
private Folder parent;

which would generate

"folder": {
"id": "1",
"parentId": "6"


Turned out that supporting this annotation was not all that difficult: although JAXB concept is little bit different from the way Jackson does it, things match well enough so that simple cases work (as per unit test). More testing would be helpful of course; but the base implementation is checked in now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment