Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 326717

Summary: Containment Mappings for generic JAXB to support validation
Product: [WebTools] Dali JPA Tools Reporter: Neil Hauge <neil.hauge>
Component: JAXBAssignee: Karen Butzke <karenfbutzke>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 Keywords: plan
Version: 3.0   
Target Milestone: 3.0 M5   
Hardware: PC   
OS: Windows 7   
Whiteboard: JAXB

Description Neil Hauge CLA 2010-09-30 17:06:43 EDT
This enhancement covers context model for the generic JAXB containment mappings, specifically:

XmlAttribute
XmlElement
XmlAdapter


See http://wiki.eclipse.org/EclipseLink/DesignDocs/277920/Phase3 for detailed info and examples for these annotations.

Context model should include standard state and behavior required for validation purposes.
Comment 1 Karen Butzke CLA 2011-01-18 16:22:02 EST
I added validation for XmlJavaTypeAdapter on a package and on an attribute.

1.If you specify an @XmlJavaTypeAdapter on a package and don't specify the type element, you get this validation message:
'The type must be specified for an XML Java type adapter on a package'

2.If you specify an @XmlJavaTypeAdapter on an attribute with a non-generic List or Collection and don't specify the type element, you get this validation message:
'The type for XML Java type adapter is not defined'
Here are 2 examples:

@XmlAttribute
@XmlJavaTypeAdapter(value=MyAdapter.class)
public List foo;

@XmlAttribute
@XmlJavaTypeAdapter(value=MyAdapter.class)
public List getFoo() {
    return this.foo;
}
Comment 2 Karen Butzke CLA 2011-01-28 14:48:04 EST
This bug has been completed for 3.0M5. Remaining issues are logged for validation (bug 335731, bug 333484), icons (bug 333664), XmlElement default mapping (bug 335697)