[jboss-dev-forums] [Design of POJO Server] - Re: JAXBDeployer
jason.greene@jboss.com
do-not-reply at jboss.com
Fri Jan 26 14:00:08 EST 2007
"adrian at jboss.org" wrote : anonymous wrote :
| |
| | JBossXB uses the xml namespace to determine the class to unmarshal
| | as the wildcard. You don't have to tell it a fixed number of classes/packages upfront
| | on the JAXBContext.
| |
|
| Either way the mapping of namespace to classes has to be known before unmarshalling, the difference is that you can lazy load classes with JBossXB. If lazy discovery is important, we should get involved with the spec and get it added.
|
| anonymous wrote :
| | JAXB is simply not extensible to abitrary wildcards.
| |
| |
| | | <xsd:choice minOccurs="0" maxOccurs="unbounded">
| | | <xsd:element name="string" type="stringType" minOccurs="0"/>
| | | <xsd:element name="blah" type="blahType" minOccurs="0"/>
| | | <xsd:any namespace="##other" processContents="strict" minOccurs="0"/>
| | | </xsd:choice>
| | |
| | | @RootElement
| | | public class MyClass
| | | {
| | | // Known bindings
| | | @XmlElement(name="string" type=StringSomething.class)
| | | @XmlElement(name="blah" type=BlahSomething.class)
| | |
| | | // Wildcard
| | | @XmlAnyElement(I'll accept anything that implements the interface!)
| | | public void setSomethings(List<Something> somethings) {}
| | | }
| | |
|
| The issue with a mapping like this is that if there is any similarity between the types that could be present on a wildcard, then using schema subtyping is more appropriate.
|
| -Jason
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4006975#4006975
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4006975
More information about the jboss-dev-forums
mailing list