Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 347504 - [Validation] @XmlEnum/@XmlEnumValue validation and content assist
Summary: [Validation] @XmlEnum/@XmlEnumValue 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 M3   Edit
Assignee: Paul Fullbright CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 327929
  Show dependency tree
 
Reported: 2011-05-27 15:15 EDT by Paul Fullbright CLA
Modified: 2011-10-25 18:00 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-05-27 15:15:24 EDT
XmlEnum and XmlEnumValue annotations need the following validation:

- XmlEnum.value should match the java type binding of the simple type definition
- the type mapped by an enum should be a simple type
- the type mapped by an enum *should* be an enumerated simple type, but may not be in certain situations (probably a warning)
- the XmlEnumValues should be valid lexical representations of the XmlEnum.value and should map to enumerations of the schema type (if the schema type is enumerated)
Comment 1 Paul Fullbright CLA 2011-05-27 15:41:01 EDT
XmlEnum needs no further content assist.

XmlEnumValue needs the following content assist:

- if the schema type resolves to a valid enumerated simple type, the values of the type should be given as completion proposals
Comment 2 Paul Fullbright CLA 2011-10-25 17:15:25 EDT
Added validation for:

- XmlEnum value should map to a simple schema type
- XmlEnumValue value should be a valid lexical value for the enum's schema type

Added content assist for:

- XmlEnumValue value when enum's schema type has enumeration values

Chose not to add validation for:

- XmlEnum.value should match the java type binding of the simple type
definition  
[The value is always a String type in code.  Lexical validation was added instead.]
- the type mapped by an enum *should* be an enumerated simple type, but may not
be in certain situations (probably a warning) 
[It is entirely valid to write out xml with enumerated values, even if it isn't a schema constraint.]

It is also intentional that no validation was added for *duplicate* XmlEnumValue values, since neither the RI nor MOXy complained in this scenario.

Committed for 3.1 M3