Android XmlPullParser Search matches(XmlPullParser pp, int type, String namespace, String name)

Here you can find the source of matches(XmlPullParser pp, int type, String namespace, String name)

Description

Tests if the current event is of the given type and if the namespace and name match.

Declaration

public static boolean matches(XmlPullParser pp, int type,
        String namespace, String name) throws XmlPullParserException 

Method Source Code

//package com.java2s;

import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;

public class Main {
    /**/*from   ww  w  .  j av a  2 s.com*/
     * Tests if the current event is of the given type and if the namespace and name match.
     * null will match any namespace and any name. If the test passes a true is returned
     * otherwise a false is returned.
     */
    public static boolean matches(XmlPullParser pp, int type,
            String namespace, String name) throws XmlPullParserException {
        boolean matches = type == pp.getEventType()
                && (namespace == null || namespace
                        .equals(pp.getNamespace()))
                && (name == null || name.equals(pp.getName()));

        return matches;
    }
}

Related

  1. beginDocument(XmlPullParser parser, String firstElementName)
  2. beginDocument(XmlPullParser parser, String firstElementName)
  3. beginDocument(XmlPullParser parser, String firstElementName)
  4. beginDocument(XmlPullParser parser, String firstElementName)
  5. matchNameSpaceUri( XmlPullParser paramXmlPullParser, String paramString)
  6. matches(XmlPullParser pp, int type, String namespace, String name)
  7. test(final XmlPullParser pp, final String tagName)
  8. requireEndDocument(final XmlPullParser pp)
  9. findChildToDepth(XmlPullParser parser, int parentDepth, String namespaceName, String name)