| Summary: | Inheritance - @XmlValue and abstract superclass | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Zdenek Farana <zdenek.farana> | ||||||||||||||
| Component: | Eclipselink | Assignee: | Blaise Doughan <blaise.doughan> | ||||||||||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||||||||||
| Severity: | minor | ||||||||||||||||
| Priority: | P3 | CC: | eclipselink.oxm-inbox, karenfbutzke | ||||||||||||||
| Version: | unspecified | ||||||||||||||||
| Target Milestone: | --- | ||||||||||||||||
| Hardware: | PC | ||||||||||||||||
| OS: | Windows 7 | ||||||||||||||||
| Whiteboard: | |||||||||||||||||
| Bug Depends on: | |||||||||||||||||
| Bug Blocks: | 344752 | ||||||||||||||||
| Attachments: |
|
||||||||||||||||
|
Description
Zdenek Farana
Created attachment 188165 [details]
Test Case
Blaise, Is this a case where MOXy supports this, but the JAXB spec does not? In section 8.9.10.2: The containing class must not extend another class (other than java.lang.Object). Though in section 8.7.1.2 I see: if the class, subClass, derives from another XML-bound class, baseClass directly or indirectly (other than java.lang.Object), then the subClass must not contain a mapped property or field annotated with @XmlValue annotation. These 2 seems to be in conflict or maybe you can explain to me what is meant here. One says it must not extend another class the other says it can't extend another *XML-bound* class. Karen,
The test case should not work as is. But there is still a bug because if the Ancestor class is marked @XmlTransient then it is no longer an XML-bound class:
package moxy.test;
import javax.xml.bind.annotation.XmlTransient;
@XmlTransient
public abstract class Ancestor {
public static String CORRECT_MARSHALLED_FOO = "<Foo><s>test</s></Foo>";
public static String CORRECT_MARSHALLED_FOO_XMLVALUE = "<Foo>test</Foo>";
private String foo2;
public String getFoo2() {
return foo2;
}
}
(In reply to comment #3) > Karen, > > The test case should not work as is. But there is still a bug because if the > Ancestor class is marked @XmlTransient then it is no longer an XML-bound class: > I thought when the package was marked with @XmlAccessorType(XmlAccessType.NONE), then none of the classes without explicit JAXB annotations were XML bound. Created attachment 194616 [details]
MOXy - Test Cases
Created attachment 194628 [details]
MOXy - Test Cases
Created attachment 194629 [details]
MOXy - Fix
Created attachment 194737 [details]
MOXy - Test Cases
Created attachment 194738 [details]
MOXy - Fix
Instead of checking to see if there is a parent class, check to see if a parent class has a field/property mapped to something other than an attribute.
Fix checked into trunk at rev: 9308 Code reviewed by: Matt MacIvor The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink |