2
votes

I am using POJO un/marshalling via JAXB and EclipseLink MOXy and it works great for to/from JSON notation.

I also have a need to process a CSV file (well actually a pipe-delimited file, what do they call that?) where each row gets unmarshalled into my POJOs.

Perhaps some custom Adapter scheme perhaps? ( http://www.eclipse.org/eclipselink/documentation/2.4/moxy/advanced_concepts006.htm )

2

2 Answers

0
votes

Currently EclipseLink MOXy supports XML and JSON. In order to support unmarshalling something like a delimited file, you could write something that converts the data to SAX events and then use that in combination with an UnmarshallerHandler obtained from the Unmarshaller.

-1
votes

For prospective readers: you could consider to use Jackson with dataformat csv