Class GtfsFileReaderBase

    • Constructor Detail

      • GtfsFileReaderBase

        protected GtfsFileReaderBase​(GtfsFileScheme fileScheme,
                                     URL gtfsLocation)
        Constructor using default gtfs reader settings
        Parameters:
        fileScheme - the file scheme this file reader is based on
        gtfsLocation - to base file location to parse from on (dir or zip file)
      • GtfsFileReaderBase

        protected GtfsFileReaderBase​(GtfsFileScheme fileScheme,
                                     URL gtfsLocation,
                                     GtfsFileConditions filePresenceCondition)
        Constructor using default gtfs reader settings
        Parameters:
        fileScheme - the file scheme this file reader is based on
        gtfsLocation - to base file location to parse from on (dir or zip file)
        filePresenceCondition - to enforce
      • GtfsFileReaderBase

        protected GtfsFileReaderBase​(GtfsFileScheme fileScheme,
                                     URL gtfsLocation,
                                     GtfsFileReaderSettings settings)
        Constructor which enforces the file to be present
        Parameters:
        fileScheme - the file scheme this file reader is based on
        gtfsLocation - to base file location to parse from on (dir or zip file)
        settings - to use
      • GtfsFileReaderBase

        protected GtfsFileReaderBase​(GtfsFileScheme fileScheme,
                                     URL gtfsLocation,
                                     GtfsFileConditions filePresenceCondition,
                                     GtfsFileReaderSettings settings)
        Constructor
        Parameters:
        fileScheme - the file scheme this file reader is based on
        gtfsLocation - to base file location to parse from on (dir or zip file)
        filePresenceCondition - to apply (optional, required, conditionally required etc.)
        settings - to use
    • Method Detail

      • setPresenceCondition

        public void setPresenceCondition​(GtfsFileConditions filePresenceCondition)
        Explicitly indicate the expectations regarding the presence of this file. When marked as optional no warnings will be logged when it is not present.
        Parameters:
        filePresenceCondition - to use
      • initialiseColumnConfiguration

        protected void initialiseColumnConfiguration​(GtfsColumnType columnType)
        Let concrete implementation determine the initially excluded columns (if any) based on the provided column type configuration passed in. Note that we log a severe when the chosen column type is not matched, i.e., concrete classes should only call this implementation once they have exhausted their specific column type configurations and not call this beforehand.
        Parameters:
        columnType - configuration to apply for initial column exclusions (if any)
      • read

        public void read​(Charset charSetToUse)
        Perform the reading of the file
        Parameters:
        charSetToUse - the charset to use
      • addHandler

        public void addHandler​(GtfsFileHandler<? extends GtfsObject> handler)
        Register handler
        Parameters:
        handler - to register
      • getFileScheme

        public GtfsFileScheme getFileScheme()
        The file scheme of this reader indicating what file it is operating on
        Returns:
        file scheme
      • getSettings

        public GtfsFileReaderSettings getSettings()
        The settings of this GTFS file reader
        Returns:
        settings
      • reset

        public void reset()
        Reset this reader and its registered handlers