THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
| Supported | Media Types | Data Model | Provider registration |
---|---|---|---|---|
Read | Yes | text/csv | org.apache.wink.common.model.csv.CsvDeserializer, | Not required. Registered by default |
Write | Yes | text/csv | org.apache.wink.common.model.csv.CsvSerializer, | Not required. Registered by default |
Examples
TBD
Producing CSV
TBD
Code Block |
---|
@GET @Produces("text/csv") public CsvTable getJohns() { CsvTable cvs = new CsvTable("Id", "First Name", "Last Name", "Email"); cvs.addRow("1","John","Kennedy","john@Kennedy.org"); cvs.addRow("2","John","Lennon","john@Lennon.org"); cvs.addRow("3","John","Malkovich","john@malkovich.org"); cvs.addRow("4","John","McCain","john@McCain.org"); return cvs; } |
Consuming CSV
TBD
Code Block |
---|
@POST @Consumes("text/csv") public void postCsv(CsvTable csv) { for (String[] row : csv.getRows()) { for(String cell: row){ System.out.print(cell + " ,"); } System.out.print("\n"); } } |
Explanation
TBD