title: How to parse a csv file and store datails in java bean class
body: <p>I need to parse a csv file and store the data into a java bean class. Like:</p>
  
  <pre><code>email,fname,lname
  imr@gmail.com,abc,xyz
  </code></pre>
  
  <p>These details into a bean class. I am able to parse a csv file. How to store details in bean class.</p>
  
  <pre><code>private static List&lt;List&lt;String&gt;&gt; readTXTFile(String csvFileName) throws IOException {
  
       String line = null;
      BufferedReader stream = null;
      List&lt;List&lt;String&gt;&gt; csvData = new ArrayList&lt;List&lt;String&gt;&gt;();
  
      try {
          stream = new BufferedReader(new FileReader(csvFileName));
          while ((line = stream.readLine()) != null) {
              String[] splitted = line.split(",");
              List&lt;String&gt; dataLine = new ArrayList&lt;String&gt;(splitted.length);
              for (String data : splitted)
                  dataLine.add(data);
              csvData.add(dataLine);
          }
      } finally {
          if (stream != null)
              stream.close();
      }
  
      return csvData;
  
  }
  </code></pre>
  
  <p>the above code is parsing csv file but i want that data to be inserted in java bean class.</p>