Using XmlJavaTypeAdapter

44 views
Skip to first unread message

Aravin

unread,
May 21, 2013, 3:30:58 PM5/21/13
to legsta...@googlegroups.com
Fady,

Is there a way to add  XmlJavaTypeAdapter to specific fields of the generated Java classes?

I am trying to trim spaces in all String fields. The incoming message contains spaces to match the width specified in the copybook, but functionally I dont need the spaces. The cross functional way to achieve this is using XmlAdapters.

How to include XmlJavaTypeAdapter in the generated Java class?

Thanks,
Aravin

Fady

unread,
May 22, 2013, 2:17:49 AM5/22/13
to legsta...@googlegroups.com
Hello Aravin,


Otherwise, I believe you should be able to use standard JAXB customization (http://docs.oracle.com/cd/E17802_01/webservices/webservices/docs/1.5/tutorial/doc/JAXBUsing4.html#wp148613) by editing the XSD.

Fady

Aravin

unread,
May 22, 2013, 11:42:53 AM5/22/13
to legsta...@googlegroups.com
Fady,

I am using coxbgen to generate the XSD from CPY. jaxbgen task creates the Java classes from the XSD.

I cant manually edit the XSD files. Is there a way that I can specify a bindings file to the jaxbgen task? I know it uses the XJC task internally which accepts a binding file, but the jaxbgen doesnt seem to accept it.

Thanks,
Aravin

Fady

unread,
May 23, 2013, 1:04:40 AM5/23/13
to legsta...@googlegroups.com
coxbgen does not generate the xsd. cob2xsd does.

the steps should be: copybook -> cob2xsd -> xsd -> add your xjc customization -> cob2xsd -> customized jaxb classes & binding classes.
Reply all
Reply to author
Forward
0 new messages