mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-19 08:49:58 +00:00
AbstractEfaProvider: Replace a few XmlPullUtil.test() with require().
This commit is contained in:
parent
3d294186bd
commit
79db154891
1 changed files with 3 additions and 6 deletions
|
@ -659,8 +659,7 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider {
|
||||||
|
|
||||||
private String processItdOdv(final XmlPullParser pp, final String expectedUsage,
|
private String processItdOdv(final XmlPullParser pp, final String expectedUsage,
|
||||||
final ProcessItdOdvCallback callback) throws XmlPullParserException, IOException {
|
final ProcessItdOdvCallback callback) throws XmlPullParserException, IOException {
|
||||||
if (!XmlPullUtil.test(pp, "itdOdv"))
|
XmlPullUtil.require(pp, "itdOdv");
|
||||||
throw new IllegalStateException("expecting <itdOdv />");
|
|
||||||
|
|
||||||
final String usage = XmlPullUtil.attr(pp, "usage");
|
final String usage = XmlPullUtil.attr(pp, "usage");
|
||||||
if (expectedUsage != null && !usage.equals(expectedUsage))
|
if (expectedUsage != null && !usage.equals(expectedUsage))
|
||||||
|
@ -725,8 +724,7 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider {
|
||||||
}
|
}
|
||||||
|
|
||||||
private String processItdOdvPlace(final XmlPullParser pp) throws XmlPullParserException, IOException {
|
private String processItdOdvPlace(final XmlPullParser pp) throws XmlPullParserException, IOException {
|
||||||
if (!XmlPullUtil.test(pp, "itdOdvPlace"))
|
XmlPullUtil.require(pp, "itdOdvPlace");
|
||||||
throw new IllegalStateException("expecting <itdOdvPlace />");
|
|
||||||
|
|
||||||
final String placeState = XmlPullUtil.attr(pp, "state");
|
final String placeState = XmlPullUtil.attr(pp, "state");
|
||||||
|
|
||||||
|
@ -743,8 +741,7 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider {
|
||||||
|
|
||||||
private Location processOdvNameElem(final XmlPullParser pp, String type, final String defaultPlace)
|
private Location processOdvNameElem(final XmlPullParser pp, String type, final String defaultPlace)
|
||||||
throws XmlPullParserException, IOException {
|
throws XmlPullParserException, IOException {
|
||||||
if (!XmlPullUtil.test(pp, "odvNameElem"))
|
XmlPullUtil.require(pp, "odvNameElem");
|
||||||
throw new IllegalStateException("expecting <odvNameElem />");
|
|
||||||
|
|
||||||
if ("any".equals(type))
|
if ("any".equals(type))
|
||||||
type = XmlPullUtil.attr(pp, "anyType");
|
type = XmlPullUtil.attr(pp, "anyType");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue