亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? kittest.java

?? html解析包 可以很方便的解析html 純java 實現
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
// HTMLParser Library $Name: v1_6_20051112 $ - A java-based parser for HTML// Copyright (C) August 26, 2003 Derrick Oswald//// Revision Control Information////    $Source: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/lexerTests/KitTest.java,v $//    $Author: derrickoswald $//    $Date: 2005/05/15 11:49:05 $//    $Revision: 1.10 $//// This library is free software; you can redistribute it and/or// modify it under the terms of the GNU Lesser General Public// License as published by the Free Software Foundation; either// version 2.1 of the License, or (at your option) any later version.//// This library is distributed in the hope that it will be useful,// but WITHOUT ANY WARRANTY; without even the implied warranty of// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU// Lesser General Public License for more details.//// You should have received a copy of the GNU Lesser General Public// License along with this library; if not, write to the Free Software// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA//package org.htmlparser.tests.lexerTests;import java.io.IOException;import java.net.URL;import java.util.Vector;import javax.swing.text.BadLocationException;import javax.swing.text.MutableAttributeSet;import javax.swing.text.html.HTML;import javax.swing.text.html.HTMLEditorKit;import javax.swing.text.html.HTMLEditorKit.Parser;import javax.swing.text.html.HTMLEditorKit.ParserCallback;import org.htmlparser.Attribute;import org.htmlparser.Node;import org.htmlparser.Tag;import org.htmlparser.nodes.AbstractNode;import org.htmlparser.lexer.Cursor;import org.htmlparser.lexer.Lexer;import org.htmlparser.util.ParserException;import org.htmlparser.util.Translate;/** * Compare output from javax.swing.text.html.HTMLEditorKit with Lexer. * This test provides a means of comparing the lexemes from * javax.swing.text.html.HTMLEditorKit.Parser class with the lexemes * produced by the org.htmlparser.lexer.Lexer class. * <blockquote> * The differences have eluded automation since the HTMLEditorKit parser * adds spurious nodes where it thinks elements need closing or it gets * confused.  The intent is to eventually incorporate this into the * 'fit test' and run it against lots of HTML pages, but so far you must * analyse the differences by hand. * </blockquote> */public class KitTest extends ParserCallback{    Vector mNodes;    int mIndex;    /**     * Creates a new instance of KitTest     * @param nodes The list of lexemes from Lexer to compare with the kit lexemes.     */    public KitTest (Vector nodes)    {        mNodes = nodes;        mIndex = 0;    }    /**     * Remove whitespace from a string.     * @param s The string to crunch.     * @return The string with whitespace characters removed.     */    String snowhite (String s)    {        int length;        char ch;        StringBuffer ret;        length = s.length ();        ret = new StringBuffer (length);        for (int i = 0; i < length; i++)        {            ch = s.charAt (i);            if (!Character.isWhitespace (ch) && !(160 == ch))                ret.append (ch);        }        return (ret.toString ());    }    /**     * Check if two strings match.     * @param s1 One string.     * @param s2 The other string.     * @return <code>true</code> if the strings are equivalent ignoring whitespace.     */    boolean match (String s1, String s2)    {        s1 = snowhite (Translate.decode (s1));        s2 = snowhite (Translate.decode (s2));        return (s1.equalsIgnoreCase (s2));    }    /**     * Callback for a text lexeme.     * @param data The text extracted from the page.     * @param pos The position in the page.     * <em>Note: This differs from the Lexer concept of position which is an     * absolute location in the HTML input stream. This position is the character     * position if the text from the page were displayed in a browser.</em>     */    public void handleText (char[] data, int pos)    {        StringBuffer sb;        String theirs;        Node node;        int match;        String ours;        sb = new StringBuffer (data.length);        for (int i = 0; i < data.length; i++)        {            if (160 == data[i])                sb.append ("&nbsp;");            else                sb.append (data[i]);        }        theirs = sb.toString ();        match = -1;        for (int i = mIndex; i < Math.min (mIndex + 25, mNodes.size ()); i++)        {            node = (Node)mNodes.elementAt (i);            ours = node.getText ();            if (match (theirs, ours))            {                match = i;                break;            }        }        if (-1 == match)        {            node = (Node)mNodes.elementAt (mIndex);            ours = node.getText ();            System.out.println ("theirs: " + theirs);            Cursor cursor = new Cursor (((AbstractNode)node).getPage (), node.getStartPosition ());            System.out.println ("ours " + cursor + ": " + ours);        }        else        {            boolean skipped = false;            for (int i = mIndex; i < match; i++)            {                ours = ((Node)mNodes.elementAt (i)).toHtml ();                if (0 != ours.trim ().length ())                {                    if (!skipped)                        System.out.println ("skipping:");                    System.out.println (ours);                    skipped = true;                }            }            if (skipped)            {                System.out.println ("to match:");                node = (Node)mNodes.elementAt (match);                Cursor cursor = new Cursor (((AbstractNode)node).getPage (), node.getStartPosition ());                System.out.println ("@" + cursor + ": " + node.toHtml ());            }//            System.out.println (" match: " + theirs);            mIndex = match + 1;        }    }    /**     * Callback for a remark lexeme.     * @param data The text extracted from the page.     * @param pos The position in the page.     * <em>Note: This differs from the Lexer concept of position which is an     * absolute location in the HTML input stream. This position is the character     * position if the text from the page were displayed in a browser.</em>     */    public void handleComment (char[] data, int pos)    {        StringBuffer sb;        String theirs;        Node node;        int match;        String ours;        sb = new StringBuffer (data.length);        sb.append (data);        theirs = sb.toString ();        match = -1;        for (int i = mIndex; i < Math.min (mIndex + 25, mNodes.size ()); i++)        {            node = (Node)mNodes.elementAt (i);            ours = node.getText ();            if (match (theirs, ours))            {                match = i;                break;            }        }        if (-1 == match)        {            node = (Node)mNodes.elementAt (mIndex);            ours = node.getText ();            System.out.println ("theirs: " + theirs);            Cursor cursor = new Cursor (((AbstractNode)node).getPage (), node.getStartPosition ());            System.out.println ("ours " + cursor + ": " + ours);        }        else        {            boolean skipped = false;            for (int i = mIndex; i < match; i++)            {                ours = ((Node)mNodes.elementAt (i)).toHtml ();                if (0 != ours.trim ().length ())                {                    if (!skipped)                        System.out.println ("skipping:");                    System.out.println (ours);                    skipped = true;                }            }            if (skipped)            {                System.out.println ("to match:");                node = (Node)mNodes.elementAt (match);                Cursor cursor = new Cursor (((AbstractNode)node).getPage (), node.getStartPosition ());                System.out.println ("@" + cursor + ": " + node.toHtml ());            }//            System.out.println (" match: " + theirs);            mIndex = match + 1;        }    }    /**     * Callback for a start tag lexeme.     * @param t The tag extracted from the page.     * @param a The attributes parsed out of the tag.     * @param pos The position in the page.     * <em>Note: This differs from the Lexer concept of position which is an     * absolute location in the HTML input stream. This position is the character     * position if the text from the page were displayed in a browser.</em>     */    public void handleStartTag (HTML.Tag t, MutableAttributeSet a, int pos)    {        String theirs;        Node node;        int match;        String ours;        theirs = t.toString ();        match = -1;        for (int i = mIndex; i < Math.min (mIndex + 25, mNodes.size ()); i++)        {            node = (Node)mNodes.elementAt (i);            if (node instanceof Tag)            {                ours = ((Attribute)(((Tag)node).getAttributesEx ().elementAt (0))).getName ();                if (match (theirs, ours))                {                    match = i;                    break;                }            }        }        if (-1 == match)        {            node = (Node)mNodes.elementAt (mIndex);            ours = node.getText ();            System.out.println ("theirs: " + theirs);            Cursor cursor = new Cursor (((AbstractNode)node).getPage (), node.getStartPosition ());            System.out.println ("ours " + cursor + ": " + ours);        }        else        {            boolean skipped = false;            for (int i = mIndex; i < match; i++)            {                ours = ((Node)mNodes.elementAt (i)).toHtml ();                if (0 != ours.trim ().length ())                {                    if (!skipped)                        System.out.println ("skipping:");                    System.out.println (ours);                    skipped = true;                }            }            if (skipped)            {                System.out.println ("to match:");                node = (Node)mNodes.elementAt (match);                Cursor cursor = new Cursor (((AbstractNode)node).getPage (), node.getStartPosition ());                System.out.println ("@" + cursor + ": " + node.toHtml ());            }//            System.out.println (" match: " + theirs);            mIndex = match + 1;        }    }    /**     * Callback for an end tag lexeme.     * @param t The tag extracted from the page.     * @param pos The position in the page.     * <em>Note: This differs from the Lexer concept of position which is an     * absolute location in the HTML input stream. This position is the character     * position if the text from the page were displayed in a browser.</em>     */    public void handleEndTag (HTML.Tag t, int pos)    {        String theirs;        Node node;        int match;        String ours;        theirs = t.toString ();        match = -1;        for (int i = mIndex; i < Math.min (mIndex + 25, mNodes.size ()); i++)        {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产高清精品网站| 成人伦理片在线| 成人免费高清在线观看| 日韩欧美一卡二卡| 日产欧产美韩系列久久99| 91精品国产丝袜白色高跟鞋| 午夜久久久久久久久久一区二区| 日韩欧美一区在线| 欧美性欧美巨大黑白大战| 91精品欧美一区二区三区综合在| 国产精品第一页第二页第三页| 日本不卡在线视频| 欧美色图第一页| 亚洲欧美怡红院| 国产精品系列在线观看| 日韩欧美一区二区在线视频| 亚洲第一福利视频在线| 一本到不卡精品视频在线观看| 国产欧美日韩视频在线观看| 久久成人免费网| 91精品国产综合久久精品app| 亚洲一区影音先锋| 色综合欧美在线视频区| 国产精品国产三级国产a| 国产一区在线观看视频| 精品久久久久久综合日本欧美| 日产精品久久久久久久性色| 欧美久久婷婷综合色| 亚洲国产一区二区在线播放| 色噜噜狠狠一区二区三区果冻| 国产精品久久久久久久午夜片| 成人理论电影网| 亚洲欧洲日韩综合一区二区| 99精品久久久久久| 亚洲精品国产第一综合99久久| 91麻豆精东视频| 尤物在线观看一区| 欧美日韩精品电影| 奇米四色…亚洲| 精品国产一二三| 国产成人免费视| 日韩理论片在线| 色999日韩国产欧美一区二区| 夜夜夜精品看看| 欧美日韩国产影片| 久久国产精品99久久人人澡| 久久综合九色综合97_久久久| 国产精品一级二级三级| 国产精品久久三| 在线观看视频91| 免费在线观看不卡| 国产婷婷色一区二区三区| 99视频热这里只有精品免费| 亚洲一区欧美一区| 日韩一二三四区| 国产成人福利片| 亚洲一区二区成人在线观看| 欧美一区二区三区视频在线| 国产精品一区二区黑丝| 亚洲人成在线观看一区二区| 欧美日韩激情一区二区| 激情综合色播五月| 国产精品久久久久久久裸模| 欧美日韩黄色影视| 国产精品一二三区在线| 一区二区三区蜜桃网| 欧美不卡一二三| 色综合一个色综合| 久久电影国产免费久久电影| 亚洲免费观看高清完整版在线 | 久久综合久久综合九色| 成人影视亚洲图片在线| 亚洲福利一区二区| 国产日韩欧美综合在线| 欧美日韩一区二区三区免费看| 国产精品亚洲第一区在线暖暖韩国| 亚洲欧美aⅴ...| 精品国产一区二区三区av性色| 日本精品视频一区二区| 激情久久五月天| 亚洲一二三专区| 中文字幕欧美激情一区| 7777精品伊人久久久大香线蕉的| 成人一区二区视频| 免费在线视频一区| 亚洲一区二区免费视频| 国产女主播一区| 日韩免费在线观看| 欧美少妇一区二区| av网站免费线看精品| 久久福利资源站| 日本网站在线观看一区二区三区 | 亚洲电影视频在线| 中文字幕制服丝袜成人av| 亚洲精品在线观看网站| 欧美日韩高清影院| 色老汉av一区二区三区| 成人ar影院免费观看视频| 久久99精品久久久久久国产越南 | 欧美三级中文字| 99精品久久99久久久久| 国产一区二区三区久久久| 毛片av一区二区三区| 午夜影院久久久| 亚洲国产美女搞黄色| 亚洲精品乱码久久久久久黑人| 国产喂奶挤奶一区二区三区| 久久久久久日产精品| 精品国产一区二区在线观看| 日韩精品中文字幕一区二区三区| 欧美男人的天堂一二区| 欧美日韩精品系列| 4438成人网| 欧美一级理论片| 91精品午夜视频| 日韩欧美色电影| 日韩欧美不卡一区| 精品国产乱码久久久久久影片| 欧美mv日韩mv| 久久久一区二区三区捆绑**| 久久影视一区二区| 欧美激情综合五月色丁香小说| 日本一区二区视频在线| 中文字幕av一区二区三区高| 国产精品电影一区二区三区| 日韩理论片在线| 亚洲国产日韩一级| 蜜臀久久99精品久久久久久9 | 亚洲一二三四区| 婷婷六月综合亚洲| 精品在线一区二区三区| 国产精品一区一区三区| 成人综合在线观看| 色88888久久久久久影院野外| 欧美日韩成人综合天天影院| 日韩精品一区二区三区在线 | 精品视频一区二区三区免费| 91精品午夜视频| 国产午夜亚洲精品午夜鲁丝片 | 亚洲va天堂va国产va久| 日欧美一区二区| 国产一区二区在线电影| 成人黄动漫网站免费app| 91视频免费观看| 欧美一级欧美三级在线观看 | 国产精品一级黄| 91久久人澡人人添人人爽欧美| 欧美久久免费观看| 国产午夜久久久久| 亚洲一区二区三区四区的 | 亚洲精品国产一区二区精华液 | 国产精品成人免费精品自在线观看 | 亚洲天堂2014| 日韩电影免费在线| 国产成人午夜视频| 7777女厕盗摄久久久| 国产日韩欧美a| 视频一区二区三区在线| 丁香啪啪综合成人亚洲小说| 在线不卡中文字幕| 亚洲欧洲日本在线| 蜜桃av一区二区| 色综合久久综合网97色综合| 精品入口麻豆88视频| 一区二区三区四区亚洲| 国产东北露脸精品视频| 欧美老肥妇做.爰bbww视频| 国产精品久线观看视频| 精品一区二区三区视频| 欧美色图天堂网| 国产精品对白交换视频| 国精产品一区一区三区mba桃花| 91精品久久久久久久99蜜桃| 中文字幕一区在线| 国产在线精品一区在线观看麻豆| 欧美日韩精品一区二区三区四区 | 日韩欧美一二三四区| 一个色综合av| 91免费国产在线观看| 国产欧美精品一区二区色综合 | 日韩免费视频一区| 午夜精品影院在线观看| 91美女精品福利| 国产精品久久影院| 国产精品456| 精品av综合导航| 美脚の诱脚舐め脚责91| 欧美一区二区在线不卡| 亚洲影院免费观看| 日本精品免费观看高清观看| 中文字幕中文字幕在线一区| 成人永久aaa| 欧美国产丝袜视频| 成人小视频免费在线观看| 久久婷婷成人综合色| 国产在线精品国自产拍免费| 久久品道一品道久久精品| 久久国产欧美日韩精品| 欧美tickling挠脚心丨vk| 狠狠色丁香久久婷婷综合丁香|