/**** * Protected Methods ****/ protected DefaultEntitySchemaFactory createEntitySchemaFactory() { return GtfsEntitySchemaFactory.createEntitySchemaFactory(); }
public GtfsWriter() { /** * Prep the Entity Schema Factories */ _entityClasses.addAll(GtfsEntitySchemaFactory.getEntityClasses()); _entityComparators.putAll(GtfsEntitySchemaFactory.getEntityComparators()); DefaultEntitySchemaFactory schemaFactory = createEntitySchemaFactory(); setEntitySchemaFactory(schemaFactory); }
private void mapEntityClassesToFilenames() { for (Class<?> entityClass : GtfsEntitySchemaFactory.getEntityClasses()) { CsvFields csvFields = entityClass.getAnnotation(CsvFields.class); if (csvFields == null) { continue; } String filename = csvFields.filename(); _entityClassesByFilename.put(filename, entityClass); } }
public static Map<Class<?>, Comparator<?>> getEntityComparators() { Map<Class<?>, Comparator<?>> comparators = new HashMap<Class<?>, Comparator<?>>(); comparators.put(Agency.class, getComparatorForIdentityBeanType(Agency.class)); comparators.put(Route.class, getComparatorForIdentityBeanType(Route.class)); comparators.put(Stop.class, getComparatorForIdentityBeanType(Stop.class)); comparators.put(Trip.class, getComparatorForIdentityBeanType(Trip.class)); comparators.put(StopTime.class, new StopTimeComparator()); comparators.put(ShapePoint.class, new ShapePointComparator()); comparators.put(ServiceCalendar.class, new ServiceCalendarComparator()); comparators.put(ServiceCalendarDate.class, new ServiceCalendarDateComparator()); return comparators; }
public GtfsWriter() { /** * Prep the Entity Schema Factories */ _entityClasses.addAll(GtfsEntitySchemaFactory.getEntityClasses()); _entityComparators.putAll(GtfsEntitySchemaFactory.getEntityComparators()); DefaultEntitySchemaFactory schemaFactory = createEntitySchemaFactory(); setEntitySchemaFactory(schemaFactory); }
for (Class<?> entityClass : GtfsEntitySchemaFactory.getEntityClasses()) { List<Object> objectsToRemove = new ArrayList<Object>(); for (Object entity : dao.getAllEntitiesForType(entityClass)) {
public static Map<Class<?>, Comparator<?>> getEntityComparators() { Map<Class<?>, Comparator<?>> comparators = new HashMap<Class<?>, Comparator<?>>(); comparators.put(Agency.class, getComparatorForIdentityBeanType(Agency.class)); comparators.put(Block.class, getComparatorForIdentityBeanType(Block.class)); comparators.put(Route.class, getComparatorForIdentityBeanType(Route.class)); comparators.put(Stop.class, getComparatorForIdentityBeanType(Stop.class)); comparators.put(Trip.class, getComparatorForIdentityBeanType(Trip.class)); comparators.put(StopTime.class, new StopTimeComparator()); comparators.put(ShapePoint.class, new ShapePointComparator()); comparators.put(ServiceCalendar.class, new ServiceCalendarComparator()); comparators.put(ServiceCalendarDate.class, new ServiceCalendarDateComparator()); return comparators; }
/**** * Protected Methods ****/ protected DefaultEntitySchemaFactory createEntitySchemaFactory() { return GtfsEntitySchemaFactory.createEntitySchemaFactory(); } }
/**** * Protected Methods ****/ protected DefaultEntitySchemaFactory createEntitySchemaFactory() { return GtfsEntitySchemaFactory.createEntitySchemaFactory(); }
/**** * Protected Methods ****/ protected DefaultEntitySchemaFactory createEntitySchemaFactory() { return GtfsEntitySchemaFactory.createEntitySchemaFactory(); } }
/** * Supplies a default entity schema factory to * {@link #readGtfsIntoStore(ApplicationContext, GenericMutableDao, DefaultEntitySchemaFactory)} * * @param context * @param store * @throws IOException */ public static void readGtfsIntoStore(ApplicationContext context, GenericMutableDao store) throws IOException { readGtfsIntoStore(context, store, GtfsEntitySchemaFactory.createEntitySchemaFactory()); }
/** * Supplies a default entity schema factory to * {@link #readGtfsIntoStore(ApplicationContext, GenericMutableDao, DefaultEntitySchemaFactory)} * * @param context * @param store * @throws IOException */ public static void readGtfsIntoStore(ApplicationContext context, GenericMutableDao store) throws IOException { readGtfsIntoStore(context, store, GtfsEntitySchemaFactory.createEntitySchemaFactory()); }
/** * Supplies a default entity schema factory to * {@link #readGtfsIntoStore(ApplicationContext, GenericMutableDao, DefaultEntitySchemaFactory)} * * @param context * @param store * @param disableStopConsolidation * @throws IOException */ public static void readGtfsIntoStore(ApplicationContext context, GenericMutableDao store, boolean disableStopConsolidation) throws IOException { readGtfsIntoStore(context, store, GtfsEntitySchemaFactory.createEntitySchemaFactory(), disableStopConsolidation); }
public static void main(String[] args) throws IOException { if (args.length != 2) { System.err.println("usage: bundle.xml output_path"); System.exit(-1); } List<String> paths = new ArrayList<String>(); paths.add(args[0]); ConfigurableApplicationContext context = ContainerLibrary.createContext(paths); GtfsDaoImpl store = new GtfsDaoImpl(); DefaultEntitySchemaFactory schema = GtfsEntitySchemaFactory.createEntitySchemaFactory(); GenericAdditionalFieldMapping.addGenericFieldMapping(schema, Stop.class, "stop_direction", "stopDirection"); GenericAdditionalFieldMapping.addGenericFieldMapping(schema, Trip.class, "block_sequence_id", "blockSequenceId"); GtfsReadingSupport.readGtfsIntoStore(context, store,schema); writeGtfs(new File(args[1]), store, schema); }
public static void main(String[] args) throws IOException { if (args.length != 2) { System.err.println("usage: bundle.xml output_path"); System.exit(-1); } List<String> paths = new ArrayList<String>(); paths.add(args[0]); ConfigurableApplicationContext context = ContainerLibrary.createContext(paths); GtfsDaoImpl store = new GtfsDaoImpl(); DefaultEntitySchemaFactory schema = GtfsEntitySchemaFactory.createEntitySchemaFactory(); GenericAdditionalFieldMapping.addGenericFieldMapping(schema, Stop.class, "stop_direction", "stopDirection"); GenericAdditionalFieldMapping.addGenericFieldMapping(schema, Trip.class, "block_sequence_id", "blockSequenceId"); GtfsReadingSupport.readGtfsIntoStore(context, store,schema); writeGtfs(new File(args[1]), store, schema); }
public static void main(String[] args) throws IOException { if (args.length != 2) { System.err.println("usage: bundle.xml output_path"); System.exit(-1); } List<String> paths = new ArrayList<String>(); paths.add(args[0]); ConfigurableApplicationContext context = ContainerLibrary.createContext(paths); GtfsDaoImpl store = new GtfsDaoImpl(); DefaultEntitySchemaFactory schema = GtfsEntitySchemaFactory.createEntitySchemaFactory(); GenericAdditionalFieldMapping.addGenericFieldMapping(schema, Stop.class, "stop_direction", "stopDirection"); GenericAdditionalFieldMapping.addGenericFieldMapping(schema, Trip.class, "block_sequence_id", "blockSequenceId"); GtfsReadingSupport.readGtfsIntoStore(context, store,schema); writeGtfs(new File(args[1]), store, schema); }
private void writeGtfs() throws IOException { if (_outputDirectory == null) { return; } _writer.setOutputLocation(_outputDirectory); DefaultEntitySchemaFactory schemaFactory = new DefaultEntitySchemaFactory(); schemaFactory.addFactory(GtfsEntitySchemaFactory.createEntitySchemaFactory()); for (SchemaUpdateStrategy strategy : _outputSchemaUpdates) strategy.updateSchema(schemaFactory); _writer.setEntitySchemaFactory(schemaFactory); _writer.run(_dao); }