I have a service which should be able to deliver "user profiles" under different level of details or different verbosity modes.
These user profiles are synchronized in a database with JPA2 and all is working fine. Using MOXy (EclipseLink) I also serialize in XML the profiles, and all is working fine here too.
However, the verbosity modes (BRIEF, SUMMARY, FULL) are implemented by the presence or the absence of specific elements in the user profiles serialized in XML (the element QueryHistory for instance, should not be serialized when using the BRIEF verbosity mode).
In few words: I want to specify to a JAXBContext that some elements must not be serialized and I want to specify it at runtime.
If I well understood, MOXy Extensible Models - Refresh http://blog.bdoughan.com/2011/06/moxy-extensible-models-refresh-example.html is able to do that, but is someone here know a simpler way to implement this feature?