ColumnCropsTable.java [src/java/m/ipat] Revision: default  Date:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package m.ipat;

import csip.ServiceException;
import data.table.column.ColumnTable;
import org.codehaus.jettison.json.JSONArray;
import org.codehaus.jettison.json.JSONException;

/**
 *
 * @author <a href="mailto:shaun.case@colostate.edu">Shaun Case</a>
 */
public class ColumnCropsTable extends ColumnTable {

    public ColumnCropsTable(String name) {
        super(name);
    }

    @Override
    protected Crops readTableData(int rowId, JSONArray dataArray) throws ServiceException {
        try {
            Crops crops = new Crops();
            crops.readAllValuesFromJSON(dataArray);
            return crops;
        } catch (JSONException ex) {
            throw new ServiceException("Cannot read crops from the input JSON for this land_unit: " + ex.getMessage(), ex);
        }

    }

}