mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-12 17:38:48 +00:00
Add XmlPullUtil.optSkipMultiple() and use it where possible.
This commit is contained in:
parent
30cc003038
commit
1587f7fa9f
2 changed files with 10 additions and 14 deletions
|
@ -707,9 +707,7 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider {
|
||||||
throw new RuntimeException("cannot handle nameState '" + nameState + "'");
|
throw new RuntimeException("cannot handle nameState '" + nameState + "'");
|
||||||
}
|
}
|
||||||
|
|
||||||
while (XmlPullUtil.test(pp, "infoLink"))
|
XmlPullUtil.optSkipMultiple(pp, "infoLink");
|
||||||
XmlPullUtil.requireSkip(pp, "infoLink");
|
|
||||||
|
|
||||||
XmlPullUtil.optSkip(pp, "odvNameInput");
|
XmlPullUtil.optSkip(pp, "odvNameInput");
|
||||||
|
|
||||||
XmlPullUtil.exit(pp, "itdOdvName");
|
XmlPullUtil.exit(pp, "itdOdvName");
|
||||||
|
@ -2261,8 +2259,7 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider {
|
||||||
XmlPullUtil.skipExit(pp, "itdTripDateTime");
|
XmlPullUtil.skipExit(pp, "itdTripDateTime");
|
||||||
|
|
||||||
XmlPullUtil.requireSkip(pp, "itdTripOptions");
|
XmlPullUtil.requireSkip(pp, "itdTripOptions");
|
||||||
while (XmlPullUtil.test(pp, "omcTaxi"))
|
XmlPullUtil.optSkipMultiple(pp, "omcTaxi");
|
||||||
XmlPullUtil.requireSkip(pp, "omcTaxi");
|
|
||||||
|
|
||||||
final List<Trip> trips = new ArrayList<Trip>();
|
final List<Trip> trips = new ArrayList<Trip>();
|
||||||
|
|
||||||
|
@ -2292,8 +2289,7 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider {
|
||||||
final int numChanges = XmlPullUtil.intAttr(pp, "changes");
|
final int numChanges = XmlPullUtil.intAttr(pp, "changes");
|
||||||
XmlPullUtil.enter(pp, "itdRoute");
|
XmlPullUtil.enter(pp, "itdRoute");
|
||||||
|
|
||||||
while (XmlPullUtil.test(pp, "itdDateTime"))
|
XmlPullUtil.optSkipMultiple(pp, "itdDateTime");
|
||||||
XmlPullUtil.next(pp);
|
|
||||||
XmlPullUtil.optSkip(pp, "itdMapItemList");
|
XmlPullUtil.optSkip(pp, "itdMapItemList");
|
||||||
|
|
||||||
XmlPullUtil.enter(pp, "itdPartialRouteList");
|
XmlPullUtil.enter(pp, "itdPartialRouteList");
|
||||||
|
@ -2887,13 +2883,7 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider {
|
||||||
XmlPullUtil.enter(pp, "tcs");
|
XmlPullUtil.enter(pp, "tcs");
|
||||||
|
|
||||||
fares = new ArrayList<Fare>(2);
|
fares = new ArrayList<Fare>(2);
|
||||||
|
XmlPullUtil.optSkipMultiple(pp, "tc"); // TODO fares
|
||||||
while (XmlPullUtil.test(pp, "tc")) {
|
|
||||||
XmlPullUtil.enter(pp, "tc");
|
|
||||||
// TODO fares
|
|
||||||
XmlPullUtil.skipExit(pp, "tc");
|
|
||||||
}
|
|
||||||
|
|
||||||
XmlPullUtil.skipExit(pp, "tcs");
|
XmlPullUtil.skipExit(pp, "tcs");
|
||||||
} else {
|
} else {
|
||||||
fares = null;
|
fares = null;
|
||||||
|
|
|
@ -106,6 +106,12 @@ public final class XmlPullUtil {
|
||||||
requireSkip(pp, tagName);
|
requireSkip(pp, tagName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void optSkipMultiple(final XmlPullParser pp, final String tagName)
|
||||||
|
throws XmlPullParserException, IOException {
|
||||||
|
while (test(pp, tagName))
|
||||||
|
requireSkip(pp, tagName);
|
||||||
|
}
|
||||||
|
|
||||||
public static void next(final XmlPullParser pp) throws XmlPullParserException, IOException {
|
public static void next(final XmlPullParser pp) throws XmlPullParserException, IOException {
|
||||||
skipSubTree(pp);
|
skipSubTree(pp);
|
||||||
pp.next();
|
pp.next();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue