Package com.sardak.antform.util

Examples of com.sardak.antform.util.CSVReader


  /**
   * set selected value
   */
  public void setValue(String value) {
    CSVReader reader = new CSVReader(separator, escapeSequence);
    List valueList = value == null ? new ArrayList() : reader.digest(value, true);
    for (Iterator iterator = buttons.iterator(); iterator.hasNext();) {
      JCheckBox checkBox = (JCheckBox) iterator.next();
      checkBox.setSelected(valueList.contains(checkBox.getText()));
    }
  }
View Full Code Here


  /**
   * get the properry s a list of values
   */
  public List asList() {
    return new CSVReader(separator, escapeSequence).digest(values, true);
  }
View Full Code Here

  /**
   * split the values
   */
  private void split() {
    CSVReader reader = new CSVReader(separator, escapeSequence);
    List valueList = reader.digest(values, true);
    splitValues = (String[]) valueList.toArray(new String[valueList.size()]);
  }
View Full Code Here

 
  /**
   * split the values into a table
   */
  public String[][] splitData(){   
    CSVReader rowReader = new CSVReader(rowSeparator, escapeSequence);
    CSVReader columnReader = new CSVReader(columnSeparator, escapeSequence);
    String data = getProject().getProperty(getProperty());
    if (data == null) {
      data = "";
    }
    List rowsList = rowReader.digest(data, false);
    List dataList = new ArrayList();
    int maxCols = cols.length;
    for (Iterator iter = rowsList.iterator(); iter.hasNext();) {
      String row = (String) iter.next();
      if (row.trim().length()==0) {
        continue;
      }
      List cells = columnReader.digest(row, true);
      String[] cellStrings = (String[]) cells.toArray(new String[cells.size()]);
      dataList.add(cellStrings);
      if (cellStrings.length>maxCols) {
        maxCols = cellStrings.length;
      }
View Full Code Here

  /**
   * split the column headers
   */
  public String[]  splitColumns(){
    CSVReader columnReader = new CSVReader(columnSeparator, escapeSequence);
    List values = columnReader.digest(columns, true);
    cols = (String[]) values.toArray(new String[values.size()]);
    return cols;
  }
View Full Code Here

TOP

Related Classes of com.sardak.antform.util.CSVReader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.