Android XmlPullParser Move to Next nextEndTag(XmlPullParser pp, String namespace, String name)

Here you can find the source of nextEndTag(XmlPullParser pp, String namespace, String name)

Description

combine nextTag(); pp.require(XmlPullParser.END_TAG, namespace, name);

License

Open Source License

Declaration

public static void nextEndTag(XmlPullParser pp, String namespace,
        String name) throws XmlPullParserException, IOException 

Method Source Code

//package com.java2s;
// for license please see accompanying LICENSE.txt file (available also at http://www.xmlpull.org/)

import java.io.IOException;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;

public class Main {
    /**/* w  w w  .ja  v  a  2  s . c om*/
     * combine nextTag(); pp.require(XmlPullParser.END_TAG, namespace, name);
     */
    public static void nextEndTag(XmlPullParser pp, String namespace,
            String name) throws XmlPullParserException, IOException {

        pp.nextTag();
        pp.require(XmlPullParser.END_TAG, namespace, name);
    }

    /**
     * Call parser nextTag() and check that it is END_TAG, throw exception if not.
     */
    public static void nextEndTag(XmlPullParser pp)
            throws XmlPullParserException, IOException {

        if (pp.nextTag() != XmlPullParser.END_TAG) {
            throw new XmlPullParserException("expected END_TAG and not"
                    + pp.getPositionDescription());
        }
    }
}

Related

  1. nextElementWithin(XmlPullParser parser, int outerDepth)
  2. nextElementWithin(XmlPullParser parser, int outerDepth)
  3. nextEndTag(XmlPullParser pp)
  4. nextEndTag(XmlPullParser pp)
  5. nextEndTag(XmlPullParser pp, String namespace, String name)
  6. nextLong(XmlPullParser parser, String tag)
  7. nextStartTag(XmlPullParser pp)
  8. nextStartTag(XmlPullParser pp)
  9. nextStartTag(XmlPullParser pp, String name)