문제

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