use of org.onebusaway.gtfs_transformer.TransformSpecificationMissingArgumentException in project onebusaway-gtfs-modules by OneBusAway.
the class TransformFactory method handleAddOperation.
/****
* Private Method
****/
private void handleAddOperation(String line, JSONObject json) throws JSONException, TransformSpecificationException {
if (!json.has(ARG_OBJ)) {
throw new TransformSpecificationMissingArgumentException(line, ARG_OBJ);
}
JSONObject objectSpec = json.getJSONObject(ARG_OBJ);
Class<?> entityType = getEntityClassFromJsonSpec(line, objectSpec);
if (entityType == null) {
throw new TransformSpecificationMissingArgumentException(line, new String[] { ARG_CLASS, ARG_FILE }, ARG_OBJ);
}
Map<String, ValueSetter> propertyUpdates = getPropertyValueSettersFromJsonObject(entityType, objectSpec, _excludeForObjectSpec);
EntitySourceImpl source = new EntitySourceImpl(entityType, propertyUpdates);
AddEntitiesTransformStrategy strategy = getStrategy(AddEntitiesTransformStrategy.class);
strategy.addEntityFactory(source);
}
Aggregations