Details
Description
Currently the methods of UnmarshalListener receive the 'target' object only. For JAXB the target object and its parent are required. And I do think that this is of interest for other Castor users working with listeners.
The problem: This issue will break the API!
In detail: UnmarshalListener is an interface which is communicated to users and extending its methods by an additional argument will break existing user code.
One other solution I though of is to create a new interface UnmarshalListenerInterface which is used instead of the current and create an abstract class UnmarshalListener that will take the role of an adapter between the new interface and old code... but still this would mean to change from:
public class MyListener implements UnmarshalListener to public class MyListener extends UnmarshalListener - if I ask the users for this change I can ask for the other also... and I would not work with such an ugly work around...
Or, I keep the old listener stuff and create a new second 'enhanced' listener interface and call both each time... having two listener setters, two listener getters, and loads of confusion what it is about... Which listener will be called first? Which listener will be maintained in future releases? and so on...
My personal favourite is to break the API! It hurts, but only once, and we're done with it.
This patch now works with all implementations using the current UnmarshalListener interface! - But this interface is deprecated.
In addition:
Two noteworthy things about this patch:
What is your opinion?