I would like JAXB to support interfaces natively without workarounds or
XmlAdapters. Though I am not familiar with the spec, it seems like JAXB should
follow the following procedure when unmarshalling a class:
1. Unmarshall using Class.newInstance().
2. If #1 won't work, search for the factoryClass and factoryMethod attributes of
the XmlType annotation and use those to generate the object.
3. If #1 and #2 won't work, search for the ObjectFactory for this package and
find a method returning the desired type.
4. If all 3 steps fail, report an error.
This feature would make JAXB easier to learn and easier to use. If this is in
conflict with the spec, I would request that this be added as a vendor-specific
feature.
I would like JAXB to support interfaces natively without workarounds or XmlAdapters. Though I am not familiar with the spec, it seems like JAXB should follow the following procedure when unmarshalling a class:
1. Unmarshall using Class.newInstance().
2. If #1 won't work, search for the factoryClass and factoryMethod attributes of
the XmlType annotation and use those to generate the object.
3. If #1 and #2 won't work, search for the ObjectFactory for this package and
find a method returning the desired type.
4. If all 3 steps fail, report an error.
This feature would make JAXB easier to learn and easier to use. If this is in conflict with the spec, I would request that this be added as a vendor-specific feature.
Environment
Operating System: All Platform: All
Affected Versions
[2.1.5]