當前位置: 首頁>>代碼示例>>Java>>正文


Java XmlPullParser.nextTag方法代碼示例

本文整理匯總了Java中org.xmlpull.v1.XmlPullParser.nextTag方法的典型用法代碼示例。如果您正苦於以下問題:Java XmlPullParser.nextTag方法的具體用法?Java XmlPullParser.nextTag怎麽用?Java XmlPullParser.nextTag使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.xmlpull.v1.XmlPullParser的用法示例。


在下文中一共展示了XmlPullParser.nextTag方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: parse

import org.xmlpull.v1.XmlPullParser; //導入方法依賴的package包/類
public List<Response> parse(Reader in) throws XmlPullParserException, IOException {
    List<Response> responses = new ArrayList<Response>();

    XmlPullParser parser = Xml.newPullParser();

    parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES,true);
    parser.setInput(in);
    parser.nextTag();

    parser.require(XmlPullParser.START_TAG, ns, "multistatus");


    while (parser.next() != XmlPullParser.END_TAG) {
        android.util.Log.d("PARSE", "1eventtype=" + parser.getEventType());

        if (parser.getEventType() != XmlPullParser.START_TAG) {
            continue;
        }
        String name = parser.getName();

        android.util.Log.d("PARSE", "1name = " + name);

        // Starts by looking for the entry tag
        if (name.equals("response")) {
            responses.add(readResponse(parser));
        } else {
            skip(parser);
        }
    }


    return responses;
}
 
開發者ID:PhilippC,項目名稱:keepass2android,代碼行數:34,代碼來源:PropfindXmlParser.java

示例2: readText

import org.xmlpull.v1.XmlPullParser; //導入方法依賴的package包/類
private String readText(XmlPullParser parser) throws IOException, XmlPullParserException {
    String result = "";
    if (parser.next() == XmlPullParser.TEXT) {
        result = parser.getText();
        parser.nextTag();
    }
    return result;
}
 
開發者ID:sdrausty,項目名稱:buildAPKsSamples,代碼行數:9,代碼來源:StackOverflowXmlParser.java

示例3: readText

import org.xmlpull.v1.XmlPullParser; //導入方法依賴的package包/類
private String readText(@NonNull XmlPullParser parser) throws IOException, XmlPullParserException {
    String result = "";

    if (parser.next() == XmlPullParser.TEXT) {
        result = parser.getText();
        parser.nextTag();
    }

    return result;
}
 
開發者ID:GuepardoApps,項目名稱:LucaHome-MediaServer,代碼行數:11,代碼來源:RssParser.java

示例4: readText

import org.xmlpull.v1.XmlPullParser; //導入方法依賴的package包/類
/**
 * reads a String value from xml tag
 *
 * @param parser
 * @return
 * @throws IOException
 * @throws XmlPullParserException
 */
private String readText(XmlPullParser parser) throws IOException, XmlPullParserException {
    String result = "";
    if (parser.next() == XmlPullParser.TEXT) {
        result = parser.getText();
        parser.nextTag();
    }
    return result;
}
 
開發者ID:Webtrekk,項目名稱:webtrekk-android-sdk,代碼行數:17,代碼來源:TrackingConfigurationXmlParser.java

示例5: getText

import org.xmlpull.v1.XmlPullParser; //導入方法依賴的package包/類
private static String getText(final XmlPullParser parser) throws XmlPullParserException,
                                                                 IOException {
    if (parser.next() == XmlPullParser.TEXT) {
        final String text = parser.getText();

        parser.nextTag();

        return text;
    }

    return null;
}
 
開發者ID:Applications-Development,項目名稱:SimpleRssReader,代碼行數:13,代碼來源:FeedParser.java

示例6: readMethodCall

import org.xmlpull.v1.XmlPullParser; //導入方法依賴的package包/類
public MethodCall readMethodCall(Socket socket) throws IOException, XmlPullParserException
{
	MethodCall methodCall = new MethodCall();
	InputStream inputStream = socket.getInputStream();

	XmlPullParser pullParser = xmlPullParserFromSocket(inputStream);
	
	pullParser.nextTag();
	pullParser.require(XmlPullParser.START_TAG, null, Tag.METHOD_CALL);
	pullParser.nextTag();
	pullParser.require(XmlPullParser.START_TAG, null, Tag.METHOD_NAME);

	methodCall.setMethodName(pullParser.nextText());

	pullParser.nextTag();
	pullParser.require(XmlPullParser.START_TAG, null, Tag.PARAMS);
	pullParser.nextTag(); // <param>
	
	do {
		//Log.d(Tag.LOG, "type=" + pullParser.getEventType() + ", tag=" + pullParser.getName());
		pullParser.require(XmlPullParser.START_TAG, null, Tag.PARAM);
		pullParser.nextTag(); // <value>

		Object param = iXMLRPCSerializer.deserialize(pullParser);
		methodCall.params.add(param); // add to return value

		pullParser.nextTag();
		pullParser.require(XmlPullParser.END_TAG, null, Tag.PARAM);
		pullParser.nextTag(); // <param> or </params>
		
	} while (!pullParser.getName().equals(Tag.PARAMS)); // </params>

	return methodCall;
}
 
開發者ID:archos-sa,項目名稱:aos-MediaLib,代碼行數:35,代碼來源:XMLRPCServer.java

示例7: readText

import org.xmlpull.v1.XmlPullParser; //導入方法依賴的package包/類
public static String readText(XmlPullParser parser)
        throws IOException, XmlPullParserException {
    String result = "";
    if (parser.next() == XmlPullParser.TEXT) {
        result = parser.getText();
        parser.nextTag();
    }
    return result;
}
 
開發者ID:if1001,項目名稱:tarefa01-blaandrade,代碼行數:10,代碼來源:ParserRSS.java

示例8: parse

import org.xmlpull.v1.XmlPullParser; //導入方法依賴的package包/類
private LocSample[] parse() throws XmlPullParserException, IOException {
    File f = new File(m_uri.getPath());
    try (FileInputStream s = new FileInputStream(f)){
        XmlPullParser parser = Xml.newPullParser();
        parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, false);
        parser.setInput(s, null);
        parser.nextTag();
        return readFeed(parser);
    }
}
 
開發者ID:ericberman,項目名稱:MyFlightbookAndroid,代碼行數:11,代碼來源:Telemetry.java

示例9: readTextValue

import org.xmlpull.v1.XmlPullParser; //導入方法依賴的package包/類
public static String readTextValue(XmlPullParser parser, String tag, String namespace) throws IOException, XmlPullParserException {
    String result = "";
    parser.require(XmlPullParser.START_TAG, namespace, tag);
    if (parser.next() == XmlPullParser.TEXT) {
        result = parser.getText();
        parser.nextTag();
    }
    parser.require(XmlPullParser.END_TAG, namespace, tag);
    return result;
}
 
開發者ID:Orange-OpenSource,項目名稱:OCast-Java,代碼行數:11,代碼來源:DialParserUtils.java

示例10: parse

import org.xmlpull.v1.XmlPullParser; //導入方法依賴的package包/類
public DialService parse(Reader xml) throws DialException {
    try {
        XmlPullParserFactory factory = XmlPullParserFactory.newInstance();
        factory.setNamespaceAware(true);
        XmlPullParser parser = factory.newPullParser();
        parser.setInput(xml);
        parser.nextTag();

        return readService(parser);
    } catch(XmlPullParserException | IOException e) {
        throw new DialException(e);
    }
}
 
開發者ID:Orange-OpenSource,項目名稱:OCast-Java,代碼行數:14,代碼來源:DialServiceParser.java

示例11: loadStringsFromResourceFile

import org.xmlpull.v1.XmlPullParser; //導入方法依賴的package包/類
private static void loadStringsFromResourceFile() {
    try {
        Resources res = UOctubreApplication.getInstance().getResources();
        InputStream in = res.getAssets().open("strings_" + currentLanguage + ".xml");
        XmlPullParser parser = Xml.newPullParser();
        parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, false);
        parser.setInput(in, null);
        parser.nextTag();
        readStrings(parser);
        in.close();

    } catch (XmlPullParserException | IOException e) {
        throw new RuntimeException(e);
    }
}
 
開發者ID:mosquitolabs,項目名稱:referendum_1o_android,代碼行數:16,代碼來源:StringsManager.java

示例12: readUrl

import org.xmlpull.v1.XmlPullParser; //導入方法依賴的package包/類
private static void readUrl(XmlPullParser parser, SearchEngine searchEngine) throws XmlPullParserException, IOException {
    parser.require(XmlPullParser.START_TAG, null, "Url");

    final String type = parser.getAttributeValue(null, "type");
    final String template = parser.getAttributeValue(null, "template");
    final String rel = parser.getAttributeValue(null, "rel");

    Uri uri = Uri.parse(template);

    while (parser.next() != XmlPullParser.END_TAG) {
        if (parser.getEventType() != XmlPullParser.START_TAG) {
            continue;
        }

        final String tag = parser.getName();

        if (tag.equals("Param")) {
            final String name = parser.getAttributeValue(null, "name");
            final String value = parser.getAttributeValue(null, "value");
            uri = uri.buildUpon().appendQueryParameter(name, value).build();
            parser.nextTag();
        } else {
            skip(parser);
        }
    }

    if (type.equals(URLTYPE_SEARCH_HTML)) {
        // Prefer mobile URIs.
        if (rel != null && rel.equals(URL_REL_MOBILE)) {
            searchEngine.resultsUris.add(0, uri);
        } else {
            searchEngine.resultsUris.add(uri);
        }
    } else if (type.equals(URLTYPE_SUGGEST_JSON)) {
        searchEngine.suggestUri = uri;
    }
}
 
開發者ID:mozilla-mobile,項目名稱:firefox-tv,代碼行數:38,代碼來源:SearchEngineParser.java

示例13: load

import org.xmlpull.v1.XmlPullParser; //導入方法依賴的package包/類
/***
 * Public method that loads settings values from XML file
 * @throws XmlPullParserException
 * @throws IOException
 */
public void load() throws XmlPullParserException, IOException {

    XmlPullParserFactory factory = XmlPullParserFactory.newInstance();
    factory.setNamespaceAware(true);
    XmlPullParser parser = factory.newPullParser();
    parser.setInput(new StringReader(getFileContent(URI)));
    parser.nextTag();

    settings = readFeed(parser);
}
 
開發者ID:Visions-Team,項目名稱:eBread,代碼行數:16,代碼來源:SettingManager.java

示例14: readText

import org.xmlpull.v1.XmlPullParser; //導入方法依賴的package包/類
/***
 * Private method that read text into tags of any kind inside XML file
 * @param parser                    the current parser used to parse the XML file
 * @return String that contains the text of the current tag
 * @throws IOException
 * @throws XmlPullParserException
 */
private String readText(XmlPullParser parser) throws IOException, XmlPullParserException {
    String result = "";
    if (parser.next() == XmlPullParser.TEXT) {
        result = parser.getText();
        parser.nextTag();
    }
    return result;
}
 
開發者ID:Visions-Team,項目名稱:eBread,代碼行數:16,代碼來源:SettingManager.java

示例15: parse

import org.xmlpull.v1.XmlPullParser; //導入方法依賴的package包/類
public static void parse(final InputStream in, final OPMLFile file) throws OPMLParserException,
                                                                        XmlPullParserException,
                                                                        IOException {
    final XmlPullParser parser = Xml.newPullParser();

    parser.setInput(in, null);

    if (isInputEncodingUnsupported(parser)) {
        parserInvalidDocument(parser);
    }

    parser.nextTag();

    if (parser.getAttributeCount() != 1) {
        parserInvalidDocument(parser);
    }

    final String version = parser.getAttributeValue(0);

    if (!version.equals(OPML_1_0) && !version.equals(OPML_1_1) && !version.equals(OPML_2_0)) {
        parserInvalidDocument(parser);
    }

    parseOPML(parser, file, version);

    in.close();
}
 
開發者ID:Applications-Development,項目名稱:SimpleRssReader,代碼行數:28,代碼來源:OPMLParser.java


注:本文中的org.xmlpull.v1.XmlPullParser.nextTag方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。