Question

I'm using void afterUnmarshal(Unmarshaller unmarshaller, Object parent) in my beans and have got the complier set to fail if parameters are not used.

The compiler seems to be okay with unused parameters if I override a superclass/interface that has a javadoc for the param.

But I can't find any class to override the afterUnmarshall method. Is there no unmarshaller interface or something like it to solve this problem?

Was it helpful?

Solution

There is not interface provided with the JAXB APIs. We designed it this way so that you could add just one of afterUnmarsal or beforeUnmarshal if you wanted. You could solve this issue by introducing your own interface:

package com.example;

public interface UnmarshallerListener {

    void afterUnmarshal(Unmarshaller unmarshaller, Object parent);

}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top