use of org.onebusaway.nextbus.model.nextbus.Agency in project onebusaway-application-modules by camsys.
the class AgencyListAction method getModel.
@Override
public Body<Agency> getModel() {
Body<Agency> body = new Body<Agency>();
try {
List<AgencyWithCoverageBean> agencies = _service.getAgenciesWithCoverage();
for (AgencyWithCoverageBean agencyBean : agencies) {
Agency agency = new Agency();
agency.setTag(agencyBean.getAgency().getId());
agency.setTitle(agencyBean.getAgency().getName());
agency.setRegionTitle(agencyBean.getAgency().getName());
body.getResponse().add(agency);
}
} catch (ServiceException e) {
body.getErrors().add(new BodyError(ErrorMsg.SERVICE_ERROR.getDescription()));
}
return body;
}
Aggregations