Search in sources :

Example 1 with SubsectionTripTransformStrategy

use of org.onebusaway.gtfs_transformer.updates.SubsectionTripTransformStrategy in project onebusaway-gtfs-modules by OneBusAway.

the class TransformFactory method handleSubsectionOperation.

private void handleSubsectionOperation(String line, JSONObject json) throws JSONException, TransformSpecificationException {
    SubsectionTripTransformStrategy strategy = getStrategy(SubsectionTripTransformStrategy.class);
    SubsectionOperation operation = new SubsectionTripTransformStrategy.SubsectionOperation();
    setObjectPropertiesFromJsonUsingCsvFields(operation, json, line);
    if (operation.getFromStopId() == null && operation.getToStopId() == null) {
        throw new TransformSpecificationException("must specify at least fromStopId or toStopId in subsection op", line);
    }
    strategy.addOperation(operation);
}
Also used : SubsectionOperation(org.onebusaway.gtfs_transformer.updates.SubsectionTripTransformStrategy.SubsectionOperation) TransformSpecificationException(org.onebusaway.gtfs_transformer.TransformSpecificationException) SubsectionTripTransformStrategy(org.onebusaway.gtfs_transformer.updates.SubsectionTripTransformStrategy)

Aggregations

TransformSpecificationException (org.onebusaway.gtfs_transformer.TransformSpecificationException)1 SubsectionTripTransformStrategy (org.onebusaway.gtfs_transformer.updates.SubsectionTripTransformStrategy)1 SubsectionOperation (org.onebusaway.gtfs_transformer.updates.SubsectionTripTransformStrategy.SubsectionOperation)1