mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-17 21:39:51 +00:00
autocomplete using XML-interface for Switzerland and Belgium
git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@300 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
parent
824bab1b5e
commit
06712bf0eb
9 changed files with 165 additions and 41 deletions
|
@ -48,6 +48,11 @@ public class OebbProvider extends AbstractHafasProvider
|
|||
public static final String NETWORK_ID = "fahrplan.oebb.at";
|
||||
private static final String API_BASE = "http://fahrplan.oebb.at/bin/";
|
||||
|
||||
public OebbProvider()
|
||||
{
|
||||
super(null, null, null);
|
||||
}
|
||||
|
||||
public boolean hasCapabilities(final Capability... capabilities)
|
||||
{
|
||||
for (final Capability capability : capabilities)
|
||||
|
@ -63,6 +68,7 @@ public class OebbProvider extends AbstractHafasProvider
|
|||
private static final Pattern P_AUTOCOMPLETE_JSON = Pattern.compile("SLs\\.sls=(.*?);SLs\\.showSuggestion\\(\\);", Pattern.DOTALL);
|
||||
private static final Pattern P_AUTOCOMPLETE_ID = Pattern.compile(".*?@L=(\\d+)@.*?");
|
||||
|
||||
@Override
|
||||
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
|
||||
{
|
||||
final String uri = String.format(AUTOCOMPLETE_URI, ParserUtils.urlEncode(constraint.toString(), ENCODING));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue