This discussion is archived
0 Replies Latest reply: May 15, 2013 8:20 PM by 1007201 RSS

xmJDK7 - compliancy with JAXB spec 2.2

1007201 Newbie
Currently Being Moderated
It's really a small doubt:
in JAXB spec 2.2, it says: ”The mapping of existing Java interfaces to schema constructs is not supported. Since an existing class can implement multiple interfaces, there is no obvious mapping of existing interfaces to XML schema constructs.”

But with JDK 7, it allows the binding of XML elements to a generic list of interface.
public interface MyInterface {
Properties getAnothernameproperties();
void setAnothernameproperties(Properties anothernameproperties);
}

public class Root {
@XmlElements(value = {
@XmlElement(name = "myObject", type = MyObject.class),
@XmlElement(name = "otherObject", type = MyOtherObject.class) })
protected List<MyInterface> myList = new ArrayList<MyInterface>();
}

Is the JDK7 implementation spec compliant or not?

Edited by: 1004198 on May 15, 2013 8:19 PM

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points