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?

有帮助吗?

解决方案

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);

}
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top