*/
public class TaskParser extends Parser<Task> {
@Override
public Task parse(Element element) {
Task task = new Task();
try {
task.setId(getInt(element, "id"));
task.setName(get(element, "name"));
task.setPosition(getInt(element, "position"));
task.setProjectId(getInt(element, "project_id"));
task.setOpenedOn(getDate(element, "opened_on"));
task.setBudget(getDecimal(element, "budget"));
task.setBillable(getBoolean(element, "billable"));
task.setSumHours(getDecimal(element, "sum_hours"));
task.setUserCount(getInt(element, "user_count"));
}
catch (PropertyVetoException ex) {
throw new RuntimeException(
"PANIC! This is a new object - there should be no vetoing",
ex);