Open Tomas-Kraus opened 15 years ago
@glassfishrobot Commented Reported by whitfordny@java.net
@glassfishrobot Commented vladfi2 said: This issue is a defect. The JAXB documentation clearly states that this is acceptable usage of @XmlJavaTypeAdapter.
Also, see issue 605.
@glassfishrobot Commented vladfi2 said: Changed issue status to defect.
@glassfishrobot Commented Was assigned to yaroska
@glassfishrobot Commented This issue was imported from java.net JIRA JAXB-586
Background information is: http://weblogs.java.net/blog/kohsuke/archive/2005/09/using_jaxb_20s.html
If you try to use the XmlJavaTypeAdapter described for a class C, it seems to only work when you are marshalling a parent class P that has C as a child property. But I want to see the ability to define an XmlJavaTypeAdapter for class C, and then when marshalling C, the adapter is used.
(I thought this would work, but it does not. If it is supposed to, then this is not an Enhancement request, but a Bug report.)
Fundamentally, we need the ability to define marshalling for final classes, or third party classes where you have no capability to add an @XmlRootElement annotation. Since JAXB is baked into JAX-WS and JAX-RS, this limitation poses serious issues with Web Service development.
I have posted questions here: http://forums.sun.com/thread.jspa?threadID=5358578&tstart=15 and here: http://forums.java.net/jive/thread.jspa?threadID=55517&tstart=30
I have since tried a simpler example... Create class C, and just call JAXB.marshal(c, System.out); The class is marhsalled, but it does NOT use my defined Adapter (I declared it at the package level, like Kohsuke Kawaguchi's blog entry).
Environment
Operating System: All Platform: All URL: http://forums.java.net/jive/thread.jspa?threadID=55517&tstart=30
Affected Versions
[2.1.8]