Examples of readEntities()


Examples of org.onebusaway.csv_entities.CsvEntityReader.readEntities()

    AnnotationDrivenEntitySchemaFactory entitySchema = new AnnotationDrivenEntitySchemaFactory();
    entitySchema.addPackageToScan("org.onebusaway.uk.naptan.csv");
    reader.setEntitySchemaFactory(entitySchema);
    ListEntityHandler<NaPTANStop> stopHandler = new ListEntityHandler<NaPTANStop>();
    reader.addEntityHandler(stopHandler);
    reader.readEntities(NaPTANStop.class);
    reader.close();
    List<NaPTANStop> stops = stopHandler.getValues();
    assertEquals(2, stops.size());
    NaPTANStop stop = stops.get(0);
    assertEquals("010000001", stop.getAtcoCode());
View Full Code Here

Examples of org.onebusaway.csv_entities.CsvEntityReader.readEntities()

      public void handleEntity(Object arg0) {
        NaPTANStop stop = (NaPTANStop) arg0;
        _stopsByAtcoId.put(stop.getAtcoCode(), stop);
      }
    });
    reader.readEntities(NaPTANStop.class);

    reader.close();

  }
View Full Code Here

Examples of org.onebusaway.csv_entities.CsvEntityReader.readEntities()

        stationLocation.setY(xy.y);
        _stationLocationsByTiploc.put(stationLocation.getTiploc(),
            stationLocation);
      }
    });
    csvEntityReader.readEntities(StationLocation.class, reader);
    reader.close();
  }

  private class MasterStationNameHandler extends DefaultContentHandler {
View Full Code Here

Examples of org.onebusaway.csv_entities.CsvEntityReader.readEntities()

    reader.addEntityHandler(handler);

    try {
      for (File file : files) {
        InputStream in = openFileForInput(file);
        reader.readEntities(BlockLocationArchiveRecord.class, in);
        in.close();
      }
    } catch (IOException ex) {
      throw new IllegalStateException(ex);
    }
View Full Code Here

Examples of org.onebusaway.csv_entities.CsvEntityReader.readEntities()

   ****/

  private void register(InputStream in) throws IOException {
    CsvEntityReader reader = getReader();
    reader.addEntityHandler(new EntityHandlerImpl());
    reader.readEntities(TccParticipantRegistrationBean.class, in);
  }

  private CsvEntityReader getReader() {
    CsvEntityReader reader = new CsvEntityReader();
    AnnotationDrivenEntitySchemaFactory factory = new AnnotationDrivenEntitySchemaFactory();
View Full Code Here

Examples of org.onebusaway.gtfs.serialization.GtfsReader.readEntities()

        if (gtfsBundle.getDefaultBikesAllowed())
            reader.addEntityHandler(new EntityBikeability(true));

        for (Class<?> entityClass : reader.getEntityClasses()) {
            LOG.info("reading entities: " + entityClass.getName());
            reader.readEntities(entityClass);
            store.flush();
            // NOTE that agencies are first in the list and read before all other entity types, so it is effective to
            // set the agencyId here. Each feed ("bundle") is loaded by a separate reader, so there is no risk of
            // agency mappings accumulating.
            if (entityClass == Agency.class) {
View Full Code Here

Examples of org.onebusaway.gtfs.serialization.GtfsReader.readEntities()

        GtfsReader reader = new GtfsReader();
        reader.addEntityHandler(handler);
        reader.setInputLocation(bundle.getPath());
        if (bundle.getDefaultAgencyId() != null)
          reader.setDefaultAgencyId(bundle.getDefaultAgencyId());
        reader.readEntities(Stop.class);
      }

      PrintWriter out = getOutputAsPrinter(remainingArgs[remainingArgs.length - 1]);

      switch (format) {
View Full Code Here

Examples of org.onebusaway.gtfs.serialization.GtfsReader.readEntities()

    reader.setInputLocation(new File(path));

    if (defaultAgencyId != null)
      reader.setDefaultAgencyId(defaultAgencyId);

    reader.readEntities(Agency.class);
    reader.readEntities(Stop.class);
    return reader.getEntityStore().getAllEntitiesForType(Stop.class);
  }

  private static TreeUnionFind<AgencyAndId> loadExistingConsolidatedStops(
View Full Code Here

Examples of org.onebusaway.gtfs.serialization.GtfsReader.readEntities()

    if (defaultAgencyId != null)
      reader.setDefaultAgencyId(defaultAgencyId);

    reader.readEntities(Agency.class);
    reader.readEntities(Stop.class);
    return reader.getEntityStore().getAllEntitiesForType(Stop.class);
  }

  private static TreeUnionFind<AgencyAndId> loadExistingConsolidatedStops(
      String path) throws IOException {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.