mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-19 00:39:58 +00:00
fix Bavaria by implementing mobile efa protocol
This commit is contained in:
parent
01bc6b6219
commit
d1a23d7fdb
6 changed files with 978 additions and 29 deletions
|
@ -21,15 +21,6 @@ public final class XmlPullUtil
|
|||
{
|
||||
public static final String XSI_NS = "http://www.w3.org/2001/XMLSchema-instance";
|
||||
|
||||
/**
|
||||
* directly jumps forward to start tag, ignoring any structure
|
||||
*/
|
||||
public static void jump(final XmlPullParser pp, final String tagName) throws XmlPullParserException, IOException
|
||||
{
|
||||
if (!jumpToStartTag(pp, null, tagName))
|
||||
throw new IllegalStateException("cannot find <" + tagName + " />");
|
||||
}
|
||||
|
||||
public static void require(final XmlPullParser pp, final String tagName) throws XmlPullParserException, IOException
|
||||
{
|
||||
pp.require(XmlPullParser.START_TAG, null, tagName);
|
||||
|
@ -91,6 +82,27 @@ public final class XmlPullUtil
|
|||
return pp.getEventType() == XmlPullParser.START_TAG && pp.getName().equals(tagName);
|
||||
}
|
||||
|
||||
public static void requireSkip(final XmlPullParser pp, final String tagName) throws XmlPullParserException, IOException
|
||||
{
|
||||
require(pp, tagName);
|
||||
|
||||
if (!pp.isEmptyElementTag())
|
||||
{
|
||||
enter(pp);
|
||||
exit(pp);
|
||||
}
|
||||
else
|
||||
{
|
||||
next(pp);
|
||||
}
|
||||
}
|
||||
|
||||
public static void optSkip(final XmlPullParser pp, final String tagName) throws XmlPullParserException, IOException
|
||||
{
|
||||
if (test(pp, tagName))
|
||||
requireSkip(pp, tagName);
|
||||
}
|
||||
|
||||
public static void next(final XmlPullParser pp) throws XmlPullParserException, IOException
|
||||
{
|
||||
skipSubTree(pp);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue