Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 348288 - [Validation] @XmlValue validation
Summary: [Validation] @XmlValue validation
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.2 M5   Edit
Assignee: Paul Fullbright CLA
QA Contact:
URL:
Whiteboard:
Keywords: plan
: 336393 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-06-03 17:37 EDT by Paul Fullbright CLA
Modified: 2012-03-22 17:25 EDT (History)
2 users (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-03 17:37:05 EDT
From the JAXB 2.2 spec (8.9.10.2)

- At most one field or a property in a class can be annotated with @XmlValue.
- @XmlValue can be used with the following annotations:
    - @XmlList - however this is redundant since @XmlList maps a type to a schema simple type that derives by list just as @XmlValue would.
    - @XmlJavaTypeAdapter
- If the type of the field or property is a collection type, then the collection item type must map to a simple schema type. Examples:
// Examples (not exhaustive): Legal usage of @XmlValue
@XmlValue List<Integer> foo; // int maps to xs:int
@XmlValue String[] foo; // String maps to xs:string
@XmlValue List<Bar> foo; // only if Bar maps to a simple
// schema type
- If the type of the field or property is not a collection type, then the type
of the property or field must map to a schema simple type.
- The containing class must not extend another class (other than
java.lang.Obect).

Also: 
- The java type containing the @XmlValue must map to a type with text content.
- If the java attribute type is a collection type, then the schema type must be a list simple type  [ More investigation needed here ]
Comment 1 Paul Fullbright CLA 2011-11-16 12:11:17 EST

*** This bug has been marked as a duplicate of bug 336393 ***
Comment 2 Paul Fullbright CLA 2011-11-16 12:14:34 EST
changing dependency direction
Comment 3 Paul Fullbright CLA 2011-11-16 12:15:02 EST
*** Bug 336393 has been marked as a duplicate of this bug. ***
Comment 4 Paul Fullbright CLA 2011-11-16 12:46:31 EST
As of 3.1 the following has been implemented:

- At most one field or a property in a class can be annotated with @XmlValue.
- XmlValue can be used with the following annotations: XmlList, XmlJavaTypeAdapter, (and actually XmlSchemaType, though our invalidation fails)

The rest is as of yet unimplemented.
Comment 5 Paul Fullbright CLA 2012-03-19 12:35:38 EDT
The remaining validation tests were implemented for M5.