javaee / jaxb-v2

Other
211 stars 99 forks source link

Natural JAXB support for interfaces #447

Open glassfishrobot opened 16 years ago

glassfishrobot commented 16 years ago

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]

glassfishrobot commented 16 years ago

Reported by tigera

glassfishrobot commented 16 years ago

Was assigned to jaxb-issues

glassfishrobot commented 7 years ago

This issue was imported from java.net JIRA JAXB-447