Monday, 8 December 2014

Is there a way to customize your getter from a jaxb unmarshalling?



I have a schema where I would like to customize the resulting getters from its unmarshalling.


What kind of custom binding would allow me to do that? An example would be a getter where I initialize the object with some default values before returning it, in the case that the object is NULL.


eg


public smapleType getSampleObject() { (if sampleObject == NULL) sampleObject.setField(0); return sampleObject; }


Is there a way to get JAXB to generate a customized getter like that?


No comments:

Post a Comment