Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 348111 - [Validation] @XmlElementRef validation and content assist
Summary: [Validation] @XmlElementRef validation and content assist
Status: RESOLVED FIXED
Alias: None
Product: Dali JPA Tools
Classification: WebTools
Component: JAXB (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows Vista
: P3 enhancement (vote)
Target Milestone: 3.1 M2   Edit
Assignee: Paul Fullbright CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-02 13:36 EDT by Paul Fullbright CLA
Modified: 2011-09-21 08:40 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Fullbright CLA 2011-06-02 13:36:23 EDT
From the JAXB 2.2 spec (8.9.3.2)

- The only other additional JAXB mapping annotations allowed with @XmlElementRef are: @XmlElementWrapper and @XmlJavaTypeAdapter.
- If the collection item type or property type (for single valued property) is javax.xml.bind.JAXBElement, then {@XmlElementRef.name(),@XmlElementRef.namespace()
} must point an element factory method with an @XmlElementDecl annotation in a class annotated with @XmlRegistry (usually ObjectFactory class generated by the schema compiler) :
   a. @XmlElementDecl.name() must equal @XmlElementRef.name()
   b. @XmlElementDecl.namespace() must equal @XmlElementRef.namespace().
- If the collection item type (for collection property) or property type (for single valued property) is not javax.xml.bind.JAXBElement, then the type referenced by the property or field must be annotated with @XmlRootElement


Content assist is needed for name and namespace.
Comment 1 Paul Fullbright CLA 2011-09-21 08:40:07 EDT
Correction from:

- If the collection item type (for collection property) or property type (for
single valued property) is not javax.xml.bind.JAXBElement, then the type
referenced by the property or field must be annotated with @XmlRootElement

to:

- If the collection item type (for collection property) or property type (for
single valued property) is not javax.xml.bind.JAXBElement, then the type
referenced by the property or field must have a type *in its hierarchy* annotated with @XmlRootElement

Completed for M2