Skip to content
Advertisement

Get progress information during JAXB de-/serialization

Is there a way to register some progress monitor on JAXB Marshaller and Unmarshaller? I would like to show some progress information in my GUI while data is de-/serialized.

I see that you can set a Unmarshaller.Listener and Marshaller.Listener, which have a “before” and “after” method. Nevertheless, I do not see any straight forward way to get the total number of elements to serialize.

I would need that obviously to calculate some “percentage done” info.

Advertisement

Answer

Is it ok to parse before unmarshalling?

If so, assuming you have a list of objects, you could do something like…

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement