Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 340364 - SCHEMA GENERATION OMITS PROPERTY WITH XMLJAVATYPEADAPTER ANNOTATION
Summary: SCHEMA GENERATION OMITS PROPERTY WITH XMLJAVATYPEADAPTER ANNOTATION
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-17 15:09 EDT by Matt MacIvor CLA
Modified: 2022-06-09 10:36 EDT (History)
0 users

See Also:


Attachments
Proposed Fix (935 bytes, patch)
2011-03-17 15:24 EDT, Matt MacIvor CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matt MacIvor CLA 2011-03-17 15:09:52 EDT
Given a class such as:
public static class NormalizedString{
    @XmlJavaTypeAdapter(NormalizedStringAdapter.class)
    private String normalized;
}

Eclispelink JAXB generates a schema definition missing the attribute.

Eclipselink JAXB:
<xsd:complexType name="normalizedString"/>

Correct Schema:
<xs:complexType name="normalizedString">
    <xs:sequence>
      <xs:element name="normalized" type="xs:string" minOccurs="0"/>
    </xs:sequence>
</xs:complexType>

Note there are correctly no public getters/setters and the member is private,
but this is still handled by Sun JAXB due to the presence of the annotation.

If we add the public accessors, this works for Eclipselink, but only
apparently because it is ignoring the annotation.  For Sun JAXB adding the  
public accessors leads to:
Exception in thread "main"
com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of
IllegalAnnotationExceptions
Class has two properties of the same name "normalized".

So the public accessors should not be present.
Comment 1 Matt MacIvor CLA 2011-03-17 15:24:41 EDT
Created attachment 191459 [details]
Proposed Fix
Comment 2 Matt MacIvor CLA 2011-03-21 10:27:17 EDT
Attached Patch checked in to SVN
Comment 3 Eclipse Webmaster CLA 2022-06-09 10:36:24 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink