ColumnLandUnitTable.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 ColumnLandUnitTable extends ColumnTable {
public ColumnLandUnitTable(String name) {
super(name);
}
@Override
protected LandUnit readTableData(int rowId, JSONArray dataArray) throws ServiceException {
try {
LandUnit landUnits = new LandUnit();
landUnits.readAllValuesFromJSON(dataArray);
return landUnits;
} catch (JSONException ex) {
throw new ServiceException("Cannot read crops from the input JSON for this land_unit: " + ex.getMessage(), ex);
}
}
}