This module contains interfaces and implementations for the SPI pattern.
The interface AirportProvider
defines the contract needed for the implementation.
Implementations should return a map of airport. The key should be the ICAO of the station and the value the Airport
object.
The project provides 2 default implementations:
DefaultAirportProvider
: The implementation uses a file contained in the projectairport.dat
for openflights.OurAirportsAirportProvider
: This implementation is based on ourairports onlines csv of countries and airport. To use this implementation make sure you have internet access.
It is possible to set the implementation to use according to the SPI pattern.
Create a file named io.github.mivek.provider.airport.AirportProvider
in the folder META-INF/services
of your application.
In this file write the fully qualified name of the implementation you want to use.
Example
io.github.mivek.provider.airport.impl.OurAirportsAirportProvider
You can use your own implementation of AirportProvider
.
Create a class extending the interface AirportProvider
, and follow the steps written above.