[Design of JBossXB] - XMLGregorianDate to xs:dateTime rather than xs:anySimpleType
by asouza_2000
Sorry guys if this is the wrong forum to post this issue, please inform me if I should move it somewhere else.
I pretty much hope you guys can help me out here.
I, via xjc, compiled a .XSD into several classes. Automatically xs:dateTime schema types are translated to XMLGregorianCalendar java type. No problem about that.
I then use some of the generated classes as WS parameters for a service I'm designing. No problem about that either.
The thing is that when JBoss WS generates the WSDL file from my service, it translates the XMLGregorianDate type to xs:anySimpleType. I checked it out and it seems that it should be the default behavior of JAXB.
I'd like to know how can I force the translation of XMLGregorianCalendar to xs:dateTime rather than put an annotation @XMLSchemaType in all the properties that are XMLGregorianCalendar types.
Thanks in advance,
Antonio Souza.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4134911#4134911
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4134911
18 years, 1 month
[Design the new POJO MicroContainer] - Re: enums, generics and other animals
by adrian@jboss.org
"alesj" wrote :
| How do you use this with attributes?
|
JBossXB will do it automatically.
1) attribute qName="urn:jboss:deployer-beans:2.0:option"
2) type qName="urn:jboss:deployer-beans:2.0:optionType"
3) convert to an object according to the config on that TypeBinding i.e. the ValueAdapter
But looking again, the problem is that we aren't using the AttributeBinding callback for
these, we're looking at the attributes directly which are just strings. :-(
See DefaultElementHandler
|
| // Don't override this
| public void attributes(Object o, QName elementName, ElementBinding element, Attributes attrs, NamespaceContext nsCtx)
| {
| if(attrsHandler != null)
| {
| attrsHandler.attributes(o, elementName, element.getType(), attrs, nsCtx);
| }
| }
|
| // Set an attribute handler on the constructor
| public DefaultElementHandler(AttributesHandler attrsHandler)
| {
| this.attrsHandler = attrsHandler;
| }
|
i.e.
|
| public class MyAttributeHandler extends AttributeHander
| {
| public void attribute(QName elemName,
| QName attrName,
| AttributeBinding binding,
| Object owner,
| Object value)
| {
| AbstractInjectionValueMetaData injection = (AbstractInjectionValueMetaData) owner;
|
| String localName = attrName.getLocalPart();
| ...
| else if ("type".equals(localName))
| injection.setInjectionType((AutowireType) value)
| }
| }
|
But I'm not sure it is worth doing all this work, since these classes are going away soon.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4134908#4134908
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4134908
18 years, 1 month