0 Replies Latest reply on Sep 4, 2013 8:11 AM by Marcio Jota Coelho

    Jsefa - CSV

    Marcio Jota Coelho Newbie

      Hi all... I need read a CSV file and deserialize it in java objects.

      I found this project : https://github.com/oasits/JSefa

      Reading the docs and samples in project, I trying use this ideia to my case. this is my file:






      and my models:


      public class Department {
           @CsvField(pos = 0)
           String name;
          @CsvSubRecordList(pos = 1, records = @Record(prefix = "0001"))
          List<Employee> employees;


      public class Employee {
          @CsvField(pos = 0)
          String name1;
          @CsvField(pos = 1)
          String name2;


      Method to deserializer...


      CsvConfiguration csvConfiguration = new CsvConfiguration();
      csvConfiguration.setFieldDelimiter((char) 124);
      Deserializer deserializer = CsvIOFactory.createFactory(csvConfiguration,Department.class).createDeserializer();
      while (deserializer.hasNext()) {
          Department parent = deserializer.next();


      The Problem...

      In my layout, the field to define a line type, is a second position, and not a first...

      I read API docs but... not found configuration for this case..

      Someone can help me? thanks...