Community
Participate
Working Groups
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 ]
*** This bug has been marked as a duplicate of bug 336393 ***
changing dependency direction
*** Bug 336393 has been marked as a duplicate of this bug. ***
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.
The remaining validation tests were implemented for M5.