Android Utililty Methods XmlPullParser Move to Next

List of utility methods to do XmlPullParser Move to Next

Description

The list of methods to do XmlPullParser Move to Next are organized into topic(s).

Method

voidnextStartTag(XmlPullParser pp)
call parser nextTag() and check that it is START_TAG, throw exception if not.
if (pp.nextTag() != XmlPullParser.START_TAG) {
    throw new XmlPullParserException("expected START_TAG and not "
            + pp.getPositionDescription());
voidnextStartTag(XmlPullParser pp, String name)
combine nextTag(); pp.require(XmlPullParser.START_TAG, null, name);
pp.nextTag();
pp.require(XmlPullParser.START_TAG, null, name);
voidnextStartTag(XmlPullParser pp, String name)
combine nextTag(); pp.require(XmlPullParser.START_TAG, null, name);
pp.nextTag();
pp.require(XmlPullParser.START_TAG, null, name);
voidnextStartTag(XmlPullParser pp, String namespace, String name)
combine nextTag(); pp.require(XmlPullParser.START_TAG, namespace, name);
pp.nextTag();
pp.require(XmlPullParser.START_TAG, namespace, name);
voidnextStartTag(XmlPullParser pp, String namespace, String name)
combine nextTag(); pp.require(XmlPullParser.START_TAG, namespace, name);
pp.nextTag();
pp.require(XmlPullParser.START_TAG, namespace, name);
StringnextString(XmlPullParser parser, String tag)
next String
parser.require(XmlPullParser.START_TAG, null, tag);
String value = readText(parser);
parser.require(XmlPullParser.END_TAG, null, tag);
return value;
StringnextText(XmlPullParser pp, String namespace, String name)
Read text content of element ith given namespace and name (use null namespace do indicate that nemspace should not be checked)
if (name == null) {
    throw new XmlPullParserException(
            "name for element can not be null");
pp.require(XmlPullParser.START_TAG, namespace, name);
return pp.nextText();
StringnextText(XmlPullParser pp, String namespace, String name)
Read text content of element ith given namespace and name (use null namespace do indicate that nemspace should not be checked)
if (name == null) {
    throw new XmlPullParserException(
            "name for element can not be null");
pp.require(XmlPullParser.START_TAG, namespace, name);
return pp.nextText();
intsafeNext(XmlPullParser parser)
safe Next
try {
    parser.next();
    while (null == parser.getName()) {
        parser.next();
    return parser.getEventType();
} catch (XmlPullParserException e) {
    e.printStackTrace();
...
voidenter(final XmlPullParser pp)
enter
skipWhitespace(pp);
if (pp.getEventType() != XmlPullParser.START_TAG)
    throw new IllegalStateException("expecting start tag to enter");
if (pp.isEmptyElementTag())
    throw new IllegalStateException("cannot enter empty tag");
pp.next();