mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-18 16:29:51 +00:00
Extract JSON get stops parameters to method
This commit is contained in:
parent
4a7743d094
commit
7acd4a0afa
21 changed files with 95 additions and 106 deletions
|
@ -19,7 +19,6 @@ package de.schildbach.pte;
|
|||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
|
@ -28,7 +27,6 @@ import de.schildbach.pte.dto.LocationType;
|
|||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.util.ParserUtils;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -178,12 +176,11 @@ public class VbbProvider extends AbstractHafasProvider
|
|||
return xmlQueryDepartures(uri.toString(), stationId);
|
||||
}
|
||||
|
||||
private static final String AUTOCOMPLETE_URI = API_BASE + "ajax-getstop.exe/dn?getstop=1&REQ0JourneyStopsS0A=255&S=%s?&js=true&";
|
||||
|
||||
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
|
||||
{
|
||||
final String uri = String.format(Locale.ENGLISH, AUTOCOMPLETE_URI, ParserUtils.urlEncode(constraint.toString(), UTF_8));
|
||||
final StringBuilder uri = new StringBuilder(getStopEndpoint);
|
||||
uri.append(jsonGetStopsParameters(constraint));
|
||||
|
||||
return jsonGetStops(uri);
|
||||
return jsonGetStops(uri.toString());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue