use of org.onebusaway.gtfs_transformer.services.GtfsTransformStrategyFactory in project onebusaway-gtfs-modules by OneBusAway.
the class TransformFactory method handleTransformOperation.
private void handleTransformOperation(String line, JSONObject json, Object factoryObj) throws JSONException, TransformSpecificationException {
setObjectPropertiesFromJsonUsingCsvFields(factoryObj, json, line);
boolean added = false;
if (factoryObj instanceof GtfsTransformStrategy) {
_transformer.addTransform((GtfsTransformStrategy) factoryObj);
added = true;
}
if (factoryObj instanceof GtfsEntityTransformStrategy) {
_transformer.addEntityTransform((GtfsEntityTransformStrategy) factoryObj);
added = true;
}
if (factoryObj instanceof GtfsTransformStrategyFactory) {
GtfsTransformStrategyFactory factory = (GtfsTransformStrategyFactory) factoryObj;
factory.createTransforms(_transformer);
added = true;
}
if (!added) {
throw new TransformSpecificationException("factory object is not an instance of GtfsTransformStrategy, GtfsEntityTransformStrategy, or GtfsTransformStrategyFactory: " + factoryObj.getClass().getName(), line);
}
}
Aggregations