| Summary: | JAXB Externalized Metadata: Support for xml-any-attribute with Dynamic JAXB | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Rick Barkhouse <rick.barkhouse> | ||||||
| Component: | Eclipselink | Assignee: | Nobody - feel free to take it <nobody> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||
| Severity: | enhancement | ||||||||
| Priority: | P3 | CC: | rick.barkhouse | ||||||
| Version: | unspecified | ||||||||
| Target Milestone: | --- | ||||||||
| Hardware: | All | ||||||||
| OS: | All | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
Created attachment 176833 [details]
Proposed patch.
Created attachment 176889 [details]
Patch.
Fixed, reviewed by dmccann. The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink |
When using an XmlAnyAttribute, two conditions must be true: - The Java attribute must be assignable to java.util.Map - The key/value types for the Map must be <QName, Object> In Dynamic JAXB, all attributes are of type Object unless they are overridden in the OXM file. However, in this case the attribute must be types in a very specific way, so we can just assume that this attribute should be typed as Map<QName, Object>. In XmlProcessor, when we are processing xml-any-attribute, we should make a special case for OXMJavaClasses: // process xml-any-attribute if (javaAttributeClass != Map) { if (javaType instanceof OXMJavaClassImpl) { // set type to be Map<QName, Object> } else { throw Exception("Attribute must be of type Map"); } }