1

I am investigating the possibility of unmarshaling a custom data format to Java objects via JAXB - for example a CSV file. Is there any way I could do that with JAXB?

I suppose there should be a way of doing that via a custom component that can be plugged into JAXB somehow [like an unmarshaller or equivalent component]?

I would like to stress again that the data to be transformed is 100% NON-xml or anything similar.

Thanks in advance !

svpernovae
  • 160
  • 2
  • 16

1 Answers1

0

In order for a JAXB (JSR-222) implementation to work with a CSV file (that doesn't offer an extension for it) you would need a component that exposed the contents of the CSV file as XML events (i.e. SAX or StAX). Then the JAXB implementation would believe it was interacting with XML even though it really isn't.

The following may help:

Community
  • 1
  • 1
bdoughan
  • 147,609
  • 23
  • 300
  • 400