mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-19 00:39:58 +00:00
Stricter structure check for Hafas station board.
This commit is contained in:
parent
0b5ee4ffb7
commit
b50dc033fd
15 changed files with 76 additions and 18 deletions
|
@ -67,6 +67,12 @@ public final class XmlPullUtil
|
|||
pp.next();
|
||||
}
|
||||
|
||||
public static void exit(final XmlPullParser pp, final String tagName) throws XmlPullParserException, IOException
|
||||
{
|
||||
pp.require(XmlPullParser.END_TAG, null, tagName);
|
||||
pp.next();
|
||||
}
|
||||
|
||||
private static void skipToEnd(final XmlPullParser pp) throws XmlPullParserException, IOException
|
||||
{
|
||||
while (pp.getEventType() != XmlPullParser.END_TAG)
|
||||
|
@ -244,4 +250,12 @@ public final class XmlPullUtil
|
|||
|
||||
return text;
|
||||
}
|
||||
|
||||
public static void requireEndDocument(final XmlPullParser pp) throws XmlPullParserException, IOException
|
||||
{
|
||||
skipWhitespace(pp);
|
||||
|
||||
if (pp.getEventType() != XmlPullParser.END_DOCUMENT)
|
||||
throw new IllegalStateException("expecting end of document: " + pp.getPositionDescription());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue