We have a class Beans used to serialize a list of generic objects into an xml.
This is done like this:
public class Call
public Beans input;
public Beans output;
@XmlJavaTypeAdapter(value = BeanAdapter.class)
public class Beans
public List<Object> bean;
Thanks to @XmlJavaTypeAdapter, we're able to write xml in
whatever form we want.
When we're serializing a Call instance:
Call call = ...
Beans beans = ...;
JAXBContext context = ...;
Marshaller marshaler = context.createMarshaller();
ObjectFactory factory = ...;
things work as expected, meaning that BeanAdapter is used during xml
serialization. But if it's happened that you want to serialize a Beans instance
itself, you start getting problems with the serialization of unknown objects. That's because JAXB does not use BeanAdapter.
We have found a similar case "How to assign an adapter
to the root element?", unfortunately with no satisfactory explanation.
That is strange.
a@href@title, b, blockquote@cite, em, i, strike, strong, sub, super, u