当前位置: 首页>>代码示例>>Java>>正文


Java Element.nextElementSibling方法代码示例

本文整理汇总了Java中org.jsoup.nodes.Element.nextElementSibling方法的典型用法代码示例。如果您正苦于以下问题:Java Element.nextElementSibling方法的具体用法?Java Element.nextElementSibling怎么用?Java Element.nextElementSibling使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jsoup.nodes.Element的用法示例。


在下文中一共展示了Element.nextElementSibling方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: call

import org.jsoup.nodes.Element; //导入方法依赖的package包/类
@Override
public Elements call(Element e, List<String> args) {
    Elements rs = new Elements();
    Element tmp = e.nextElementSibling();
    while (tmp != null) {
        rs.add(tmp);
        tmp = tmp.nextElementSibling();
    }
    return rs;
}
 
开发者ID:virjar,项目名称:sipsoup,代码行数:11,代码来源:FollowingSiblingFunction.java

示例2: call

import org.jsoup.nodes.Element; //导入方法依赖的package包/类
@Override
public Elements call(Element e, List<String> args) {
    Elements rs = new Elements();
    if (e.nextElementSibling() != null) {
        rs.add(e.nextElementSibling());
    }
    return rs;
}
 
开发者ID:virjar,项目名称:sipsoup,代码行数:9,代码来源:FollowingSiblingOneFunction.java

示例3: followingSibling

import org.jsoup.nodes.Element; //导入方法依赖的package包/类
/**
 * 节点后面的全部同胞节点following-sibling
 * @param e
 * @return
 */
public Elements followingSibling(Element e){
    Elements rs = new Elements();
    Element tmp = e.nextElementSibling();
    while (tmp!=null){
        rs.add(tmp);
        tmp = tmp.nextElementSibling();
    }
    return rs;
}
 
开发者ID:Yinqingseu,项目名称:SeleniumTest,代码行数:15,代码来源:AxisSelector.java

示例4: followingSiblingOne

import org.jsoup.nodes.Element; //导入方法依赖的package包/类
/**
 * 返回下一个同胞节点(扩展) 语法 following-sibling-one
 * @param e
 * @return
 */
public Elements followingSiblingOne(Element e){
    Elements rs = new Elements();
    if (e.nextElementSibling()!=null){
        rs.add(e.nextElementSibling());
    }
    return rs;
}
 
开发者ID:Yinqingseu,项目名称:SeleniumTest,代码行数:13,代码来源:AxisSelector.java

示例5: wordLookup

import org.jsoup.nodes.Element; //导入方法依赖的package包/类
public List<Definition> wordLookup(String key) {
    try {
        Document doc = Jsoup.connect(wordUrl + key)
                .userAgent("Mozilla")
                .timeout(5000)
                .get();
        Elements entrys = doc.select("div.concept_light");
        ArrayList<Definition> defList = new ArrayList<>();
        if (entrys.size() > 0) {
            for (Element ele : entrys){
                String furigana = "";
                String writing = "";
                String mp3_url = "";
                //String meaning_tag = "";
                //String definition = "";
                Elements furigana_soup = ele.select("span.furigana");
                if(furigana_soup.size() > 0){
                    furigana = furigana_soup.get(0).text().trim();
                }

                Elements writing_soup = ele.select("span.text");
                if(writing_soup.size() > 0){
                    writing = writing_soup.get(0).text().trim();
                }

                Elements audio_soup = ele.select("audio > source");
                if(audio_soup.size() > 0){
                    mp3_url = "[sound:" +audio_soup.get(0).attr("src") + "]";
                }

                Elements meaning_tags_soup = ele.select("div.meaning-tags");
                for(Element tag : meaning_tags_soup){
                    String meaning_tag = tag.text().trim();
                    Element word_def_soup = tag.nextElementSibling();
                    if(word_def_soup != null){
                        for(Element defSoup : word_def_soup.select("div.meaning-definition > span.meaning-meaning")){
                            HashMap<String, String> defMap = new HashMap<>();
                            String definition = "<i><font color='grey'>" + meaning_tag + "</font></i> " + defSoup.text().trim();
                            defMap.put(EXP_ELE[0], writing);
                            defMap.put(EXP_ELE[1], furigana);
                            defMap.put(EXP_ELE[2], mp3_url);
                            //defMap.put(EXP_ELE[3], meaning_tag);
                            defMap.put(EXP_ELE[3], definition);
                            String audioIndicator = "";
                            if(!mp3_url.isEmpty()){
                                audioIndicator = "<font color='#227D51' >"+AUDIO_TAG + "</font>";
                            }
                            String export_html = "<b>" + writing + "</b> <font color='grey'>" + furigana + "</font> " + audioIndicator + "<br/>" + definition;
                            defList.add(new Definition(defMap, export_html));
                        }
                    }
                }
            }
        }

        return defList;
    } catch (IOException ioe) {
        //Log.d("time out", Log.getStackTraceString(ioe));
        Toast.makeText(MyApplication.getContext(), Log.getStackTraceString(ioe), Toast.LENGTH_SHORT).show();
        return new ArrayList<Definition>();
    }

}
 
开发者ID:mmjang,项目名称:quiz_helper,代码行数:64,代码来源:JiSho.java


注:本文中的org.jsoup.nodes.Element.nextElementSibling方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。