public void processWeatherStationConfiguration() throws ConfigurationException {
    weatherStations.clear();
    for (int i = 1; i < Integer.MAX_VALUE; i++) {
      final String weatherStationValue = "weatherstation" + i;
      final String weatherStationName = config.getProperty(weatherStationValue + "_name");
      if (weatherStationName == null) {
        // No more weather stations to parse.
        break;
      } else {
        // Instantiate weather station based on weatherstation_type value.
        if (config.getProperty(weatherStationValue + "_type") == null) {
          throw new ConfigurationException("ERROR: " + "no weather station type for "
              + weatherStationValue + "_type");
        }
        WeatherStation w = null;
        final String weatherStationType = config.getProperty(weatherStationValue + "_type");
        for (final WeatherStationType type : WeatherStation.WeatherStationType.values()) {
          if (weatherStationType.toUpperCase().matches(type.name())) {
            if (type.name().matches("WUNDERGROUND")) {

              if (config.getProperty(weatherStationValue + "_stationid") == null) {
                throw new ConfigurationException("ERROR: " + "no stationid type for "
                    + weatherStationValue + "_stationid");
              }
              final String stationId = config.getProperty(weatherStationValue + "_stationid");

              if (config.getProperty(weatherStationValue + "_api") == null) {
                throw new ConfigurationException("ERROR: " + "no api key for "
                    + weatherStationValue + "_api");
              }
              final String api = config.getProperty(weatherStationValue + "_api");

              w = new WeatherUndergroundStation(weatherStationName, api, stationId);
            }
          }
        }
        if (w == null) {
          throw new ConfigurationException("ERROR: " + weatherStationType
              + " is not a valid weather station type for " + weatherStationValue + "_type");
        }

        // Weather Station configuration has passed, add it to the list of weatherstations.
        weatherStations.add(w);
      }
    }
  }