I am using JAXB to marshall. I have noticed that when I am marshaling an object inside another object, the method for the inner object (for example: object A has a field of type B. Object B has a getter for a String) - this method is called twice (the getter for the String). Once for checking if not null (via hasValue method) and another time for getting the actual value (via writeLeafElememnt).
This seems awfully inefficient. Any thoughts on how to bypass this functionality?
Thank you very much.