Unmarshalling a fixed width string to an Object

454 views
Skip to first unread message

Ashish Sharma

unread,
May 28, 2014, 7:29:06 PM5/28/14
to bea...@googlegroups.com
Hi,

I need some help with unmarshalling a fixed width String to a java object. Scenario is that I am getting a JMS message with string payload. The string has data at fixed positions that has to be parsed to a java bean. Most of the examples that I have come across deals with files (or streams in general). Is there a way in BeanIO to parse a string without the need of any mapping XML?

Thanks much!

Sreenivasulu Arcot

unread,
May 29, 2014, 9:30:09 AM5/29/14
to bea...@googlegroups.com
Hi Ashish,

When parsing a File, contents of the File are read and copied to a String or String buffer and the they are parsed to object using BEANIO. Refer to the documentation for more details.

best regards


--
You received this message because you are subscribed to the Google Groups "beanio-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beanio+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kevin

unread,
May 30, 2014, 9:24:06 PM5/30/14
to bea...@googlegroups.com
Hi Ashish,

Please refer to the reference guide at http://beanio.org/2.1/docs/reference.  You'll probably want to use a Marshaller/Unmarshaller instead of a BeanReader/BeanWriter.  And if you don't want to create a mapping file, you can accomplish most things using annotations (release 2.1.x and higher).

Thanks,
Kevin
Reply all
Reply to author
Forward
0 new messages