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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? tagnode.java

?? 本程序用于對(duì)頁面信息進(jìn)行提取并分析
?? JAVA
?? 第 1 頁 / 共 2 頁
字號(hào):
// HTMLParser Library $Name: v1_6_20060319 $ - A java-based parser for HTML// http://sourceforge.org/projects/htmlparser// Copyright (C) 2004 Derrick Oswald//// Revision Control Information//// $Source: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/nodes/TagNode.java,v $// $Author: derrickoswald $// $Date: 2005/04/10 23:20:44 $// $Revision: 1.6 $//// 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.nodes;import java.util.Enumeration;import java.util.Hashtable;import java.util.Locale;import java.util.Vector;import org.htmlparser.Attribute;import org.htmlparser.Tag;import org.htmlparser.lexer.Cursor;import org.htmlparser.lexer.Lexer;import org.htmlparser.lexer.Page;import org.htmlparser.scanners.Scanner;import org.htmlparser.scanners.TagScanner;import org.htmlparser.util.ParserException;import org.htmlparser.util.SpecialHashtable;import org.htmlparser.visitors.NodeVisitor;/** * TagNode represents a generic tag. * If no scanner is registered for a given tag name, this is what you get. * This is also the base class for all tags created by the parser. */public class TagNode    extends        AbstractNode    implements        Tag{    /**     * An empty set of tag names.     */    private final static String[] NONE = new String[0];        /**     * The scanner for this tag.     */    private Scanner mScanner;        /**     * The default scanner for non-composite tags.     */    protected final static Scanner mDefaultScanner = new TagScanner ();    /**     * The tag attributes.     * Objects of type {@link Attribute}.     * The first element is the tag name, subsequent elements being either     * whitespace or real attributes.     */    protected Vector mAttributes;    /**     * Set of tags that breaks the flow.     */    protected static Hashtable breakTags;    static    {        breakTags = new Hashtable (30);        breakTags.put ("BLOCKQUOTE", Boolean.TRUE);        breakTags.put ("BODY", Boolean.TRUE);        breakTags.put ("BR", Boolean.TRUE);        breakTags.put ("CENTER", Boolean.TRUE);        breakTags.put ("DD", Boolean.TRUE);        breakTags.put ("DIR", Boolean.TRUE);        breakTags.put ("DIV", Boolean.TRUE);        breakTags.put ("DL", Boolean.TRUE);        breakTags.put ("DT", Boolean.TRUE);        breakTags.put ("FORM", Boolean.TRUE);        breakTags.put ("H1", Boolean.TRUE);        breakTags.put ("H2", Boolean.TRUE);        breakTags.put ("H3", Boolean.TRUE);        breakTags.put ("H4", Boolean.TRUE);        breakTags.put ("H5", Boolean.TRUE);        breakTags.put ("H6", Boolean.TRUE);        breakTags.put ("HEAD", Boolean.TRUE);        breakTags.put ("HR", Boolean.TRUE);        breakTags.put ("HTML", Boolean.TRUE);        breakTags.put ("ISINDEX", Boolean.TRUE);        breakTags.put ("LI", Boolean.TRUE);        breakTags.put ("MENU", Boolean.TRUE);        breakTags.put ("NOFRAMES", Boolean.TRUE);        breakTags.put ("OL", Boolean.TRUE);        breakTags.put ("P", Boolean.TRUE);        breakTags.put ("PRE", Boolean.TRUE);        breakTags.put ("TD", Boolean.TRUE);        breakTags.put ("TH", Boolean.TRUE);        breakTags.put ("TITLE", Boolean.TRUE);        breakTags.put ("UL", Boolean.TRUE);    }    /**     * Create an empty tag.     */    public TagNode ()    {        this (null, -1, -1, new Vector ());    }    /**     * Create a tag with the location and attributes provided     * @param page The page this tag was read from.     * @param start The starting offset of this node within the page.     * @param end The ending offset of this node within the page.     * @param attributes The list of attributes that were parsed in this tag.     * @see Attribute     */    public TagNode (Page page, int start, int end, Vector attributes)    {        super (page, start, end);        mScanner = mDefaultScanner;        mAttributes = attributes;        if ((null == mAttributes) || (0 == mAttributes.size ()))        {            String[] names;            names = getIds ();            if ((null != names) && (0 != names.length))                setTagName (names[0]);            else                setTagName (""); // make sure it's not null        }    }    /**     * Create a tag like the one provided.     * @param tag The tag to emulate.     * @param scanner The scanner for this tag.     */    public TagNode (TagNode tag, TagScanner scanner)    {        this (tag.getPage (), tag.getTagBegin (), tag.getTagEnd (), tag.getAttributesEx ());        setThisScanner (scanner);    }    /**     * Returns the value of an attribute.     * @param name Name of attribute, case insensitive.     * @return The value associated with the attribute or null if it does     * not exist, or is a stand-alone or     */    public String getAttribute (String name)    {        Attribute attribute;        String ret;        ret = null;        if (name.equalsIgnoreCase (SpecialHashtable.TAGNAME))            ret = ((Attribute)getAttributesEx ().elementAt (0)).getName ();        else        {            attribute = getAttributeEx (name);            if (null != attribute)                ret = attribute.getValue ();        }        return (ret);    }    /**     * Set attribute with given key, value pair.     * Figures out a quote character to use if necessary.     * @param key The name of the attribute.     * @param value The value of the attribute.     */    public void setAttribute (String key, String value)    {        char ch;        boolean needed;        boolean singleq;        boolean doubleq;        String ref;        StringBuffer buffer;        char quote;        Attribute attribute;        // first determine if there's whitespace in the value        // and while we'return at it find a suitable quote character        needed = false;        singleq = true;        doubleq = true;        if (null != value)            for (int i = 0; i < value.length (); i++)            {                ch = value.charAt (i);                if (Character.isWhitespace (ch))                    needed = true;                else if ('\'' == ch)                    singleq  = false;                else if ('"' == ch)                    doubleq = false;            }        // now apply quoting        if (needed)        {            if (doubleq)                quote = '"';            else if (singleq)                quote = '\'';            else            {                // uh-oh, we need to convert some quotes into character references                // convert all double quotes into &#34;                quote = '"';                ref = "&quot;"; // Translate.encode (quote);                // JDK 1.4: value = value.replaceAll ("\"", ref);                buffer = new StringBuffer (value.length() * 5);                for (int i = 0; i < value.length (); i++)                {                    ch = value.charAt (i);                    if (quote == ch)                        buffer.append (ref);                    else                        buffer.append (ch);                }                value = buffer.toString ();            }        }        else            quote = 0;        attribute = getAttributeEx (key);        if (null != attribute)        {   // see if we can splice it in rather than replace it            attribute.setValue (value);            if (0 != quote)                attribute.setQuote (quote);        }        else            setAttribute (key, value, quote);    }    /**     * Remove the attribute with the given key, if it exists.     * @param key The name of the attribute.     */    public void removeAttribute (String key)    {        Attribute attribute;        attribute = getAttributeEx (key);        if (null != attribute)            getAttributesEx ().remove (attribute);    }    /**     * Set attribute with given key, value pair where the value is quoted by quote.     * @param key The name of the attribute.     * @param value The value of the attribute.     * @param quote The quote character to be used around value.     * If zero, it is an unquoted value.     */    public void setAttribute (String key, String value, char quote)    {        setAttribute (new Attribute (key, value, quote));    }    /**     * Returns the attribute with the given name.     * @param name Name of attribute, case insensitive.     * @return The attribute or null if it does     * not exist.     */    public Attribute getAttributeEx (String name)    {        Vector attributes;        int size;        Attribute attribute;        String string;        Attribute ret;        ret = null;        attributes = getAttributesEx ();        if (null != attributes)        {            size = attributes.size ();            for (int i = 0; i < size; i++)            {                attribute = (Attribute)attributes.elementAt (i);                string = attribute.getName ();                if ((null != string) && name.equalsIgnoreCase (string))                {                    ret = attribute;                    i = size; // exit fast                }            }        }        return (ret);    }    /**     * Set an attribute.     * @param attribute The attribute to set.     * @see #setAttribute(Attribute)     */    public void setAttributeEx (Attribute attribute)    {        setAttribute (attribute);    }    /**     * Set an attribute.     * This replaces an attribute of the same name.     * To set the zeroth attribute (the tag name), use setTagName().     * @param attribute The attribute to set.     */    public void setAttribute (Attribute attribute)    {        boolean replaced;        Vector attributes;        int length;        String name;        Attribute test;        String test_name;        replaced = false;        attributes = getAttributesEx ();        length =  attributes.size ();        if (0 < length)        {            name = attribute.getName ();            for (int i = 1; i < attributes.size (); i++)            {                test = (Attribute)attributes.elementAt (i);                test_name = test.getName ();                if (null != test_name)                    if (test_name.equalsIgnoreCase (name))                    {                        attributes.setElementAt (attribute, i);                        replaced = true;                    }            }        }        if (!replaced)        {            // add whitespace between attributes            if ((0 != length) && !((Attribute)attributes.elementAt (length - 1)).isWhitespace ())                attributes.addElement (new Attribute (" "));            attributes.addElement (attribute);        }    }    /**     * Gets the attributes in the tag.     * @return Returns the list of {@link Attribute Attributes} in the tag.     * The first element is the tag name, subsequent elements being either     * whitespace or real attributes.     */    public Vector getAttributesEx ()    {        return (mAttributes);    }    /**     * Gets the attributes in the tag.     * This is not the preferred  method to get attributes, see {@link     * #getAttributesEx getAttributesEx} which returns a list of {@link     * Attribute} objects, which offer more information than the simple     * <code>String</code> objects available from this <code>Hashtable</code>.     * @return Returns a list of name/value pairs representing the attributes.     * These are not in order, the keys (names) are converted to uppercase and the values     * are not quoted, even if they need to be. The table <em>will</em> return     * <code>null</code> if there was no value for an attribute (no equals     * sign or nothing to the right of the equals sign). A special entry with     * a key of SpecialHashtable.TAGNAME ("$<TAGNAME>$") holds the tag name.     * The conversion to uppercase is performed with an ENGLISH locale.     */    public Hashtable getAttributes ()    {        Vector attributes;        Attribute attribute;        String value;        Hashtable ret;        ret = new SpecialHashtable ();        attributes = getAttributesEx ();        if (0 < attributes.size ())        {            // special handling for the node name            attribute = (Attribute)attributes.elementAt (0);            ret.put (SpecialHashtable.TAGNAME, attribute.getName ().toUpperCase (Locale.ENGLISH));            // the rest            for (int i = 1; i < attributes.size (); i++)            {                attribute = (Attribute)attributes.elementAt (i);                if (!attribute.isWhitespace ())                {                    value = attribute.getValue ();                    if (attribute.isEmpty ())                        value = SpecialHashtable.NOTHING;                    if (null == value)                        value = SpecialHashtable.NULLVALUE;                    ret.put (attribute.getName ().toUpperCase (Locale.ENGLISH), value);                }            }        }        else            ret.put (SpecialHashtable.TAGNAME, "");        return (ret);    }    /**     * Return the name of this tag.     * <p>     * <em>     * Note: This value is converted to uppercase and does not     * begin with "/" if it is an end tag. Nor does it end with     * a slash in the case of an XML type tag.     * To get at the original text of the tag name use     * {@link #getRawTagName getRawTagName()}.     * The conversion to uppercase is performed with an ENGLISH locale.     * </em>     * @return The tag name.     */    public String getTagName ()    {        String ret;        ret = getRawTagName ();        if (null != ret)        {            ret = ret.toUpperCase (Locale.ENGLISH);            if (ret.startsWith ("/"))                ret = ret.substring (1);            if (ret.endsWith ("/"))                ret = ret.substring (0, ret.length () - 1);        }        return (ret);    }    /**     * Return the name of this tag.     * @return The tag name or null if this tag contains nothing or only     * whitespace.     */    public String getRawTagName ()    {        Vector attributes;        String ret;        ret = null;                attributes = getAttributesEx ();        if (0 != attributes.size ())            ret = ((Attribute)attributes.elementAt (0)).getName ();        return (ret);    }    /**     * Set the name of this tag.     * This creates or replaces the first attribute of the tag (the     * zeroth element of the attribute vector).     * @param name The tag name.     */    public void setTagName (String name)    {        Attribute attribute;        Vector attributes;        Attribute zeroth;

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲午夜羞羞片| 91麻豆蜜桃一区二区三区| 性感美女久久精品| 亚洲一区在线观看免费观看电影高清| 中文字幕在线不卡视频| 国产精品美女久久久久aⅴ国产馆 国产精品美女久久久久av爽李琼 国产精品美女久久久久高潮 | 欧美色爱综合网| 91碰在线视频| 欧美亚洲日本国产| 欧美日韩精品一区二区天天拍小说| 成人的网站免费观看| av不卡在线播放| 不卡一区在线观看| 99re66热这里只有精品3直播 | 91视频www| 在线影院国内精品| 精品视频1区2区3区| 日韩网站在线看片你懂的| 日韩精品中文字幕在线一区| 久久天天做天天爱综合色| 久久久久88色偷偷免费| 国产精品国产三级国产有无不卡 | 国产人久久人人人人爽| 国产欧美综合在线| 亚洲蜜臀av乱码久久精品蜜桃| 亚洲精品写真福利| 偷偷要91色婷婷| 美女精品自拍一二三四| 国产激情视频一区二区三区欧美| 成人午夜电影网站| 欧美体内she精高潮| 欧美一区二区三区小说| 久久先锋影音av| 成人免费在线视频观看| 亚洲国产日韩在线一区模特| 蜜乳av一区二区| 处破女av一区二区| 欧美日韩一级片网站| 日韩一级完整毛片| 中文字幕不卡的av| 亚洲大片精品永久免费| 黑人巨大精品欧美黑白配亚洲| 不卡一区二区三区四区| 欧美日韩卡一卡二| 国产午夜精品一区二区三区嫩草 | 日韩欧美亚洲国产另类| 国产精品妹子av| 丝袜亚洲另类欧美| 国产高清精品网站| 欧美在线播放高清精品| 精品欧美一区二区三区精品久久| 综合电影一区二区三区| 久久精品国产亚洲高清剧情介绍 | 韩日欧美一区二区三区| 色先锋资源久久综合| 精品久久久网站| 亚洲精品久久嫩草网站秘色| 久久成人综合网| 欧美在线影院一区二区| 久久久国际精品| 五月婷婷综合在线| gogogo免费视频观看亚洲一| 欧美一区二区三区色| 亚洲男同性恋视频| 国产成人综合网站| 91精品婷婷国产综合久久竹菊| 亚洲欧洲另类国产综合| 久久99精品国产麻豆不卡| 欧美性大战久久久| 国产精品欧美极品| 精品一区在线看| 欧美图片一区二区三区| 成人免费小视频| 国产精品一区二区你懂的| 8x8x8国产精品| 一区二区三区欧美久久| 成人丝袜18视频在线观看| 欧美精品99久久久**| 亚洲人成影院在线观看| 粉嫩嫩av羞羞动漫久久久| 欧美一级日韩一级| 天堂一区二区在线| 欧美在线综合视频| 亚洲精品成a人| 99精品国产一区二区三区不卡| 欧美电影免费观看高清完整版在 | 欧美国产精品一区二区三区| 美女视频网站久久| 欧美精品久久久久久久久老牛影院| 中文字幕亚洲一区二区av在线| 国产河南妇女毛片精品久久久| 欧美一区二区三区四区高清| 午夜精品久久久久影视| 久久久久久久久久看片| 蜜桃在线一区二区三区| 欧美一区二区播放| 肉丝袜脚交视频一区二区| 欧美色精品天天在线观看视频| 一区二区三区四区蜜桃| 在线观看日韩精品| 亚洲精品高清在线观看| 91亚洲永久精品| 亚洲色图在线视频| 91网址在线看| 亚洲欧美日韩国产综合在线| 色网站国产精品| 亚洲自拍欧美精品| 在线精品视频小说1| 亚洲激情在线播放| 欧美天堂亚洲电影院在线播放| 亚洲成人免费看| 91精品综合久久久久久| 美国一区二区三区在线播放| 日韩欧美美女一区二区三区| 蜜臀久久久99精品久久久久久| 日韩美女在线视频| 国产精品自产自拍| 国产精品私人自拍| 色综合久久中文综合久久牛| 亚洲第一搞黄网站| 91精选在线观看| 国产一区二区三区最好精华液| 久久精品男人天堂av| youjizz久久| 亚洲制服丝袜在线| 日韩一区二区三区视频| 韩国成人福利片在线播放| 国产午夜精品在线观看| 91啪亚洲精品| 日韩电影免费一区| 久久久不卡网国产精品一区| 成人av资源站| 亚洲成人手机在线| 2024国产精品| av中文字幕在线不卡| 亚洲国产一区二区在线播放| 日韩欧美色电影| av一本久道久久综合久久鬼色| 亚洲男同性恋视频| 日韩视频在线你懂得| 国产不卡在线视频| 亚洲第一av色| 久久久久久久久久电影| 一本色道亚洲精品aⅴ| 日韩国产成人精品| 国产农村妇女毛片精品久久麻豆 | 99久免费精品视频在线观看| 亚洲女爱视频在线| 欧美成人video| 91在线免费视频观看| 美女脱光内衣内裤视频久久影院| 国产精品久久影院| 91麻豆精品国产91久久久资源速度| 国产一区二区精品在线观看| 亚洲综合在线免费观看| 久久你懂得1024| 精品视频一区三区九区| 国产成人亚洲综合色影视| 亚洲成人资源在线| 欧美韩国日本一区| 欧美一级电影网站| 91污片在线观看| 国产在线视频不卡二| 亚洲一区二区av在线| 久久久久高清精品| 制服丝袜中文字幕一区| 成人动漫一区二区在线| 人禽交欧美网站| 亚洲一区二区在线免费看| 国产亚洲人成网站| 欧美高清hd18日本| 色妞www精品视频| 国产成人自拍网| 免费欧美在线视频| 亚洲在线一区二区三区| 欧美国产日韩a欧美在线观看| 日韩欧美区一区二| 欧美欧美午夜aⅴ在线观看| 99精品视频在线免费观看| 久久99九九99精品| 日本午夜精品视频在线观看 | 五月激情综合婷婷| 亚洲色欲色欲www在线观看| 国产亚洲成aⅴ人片在线观看 | 国产精品久久久久久久蜜臀| 欧美tickling网站挠脚心| 在线播放/欧美激情| 欧美这里有精品| 日本久久电影网| www.欧美色图| 国产高清不卡一区二区| 久久99精品久久久久久| 免费成人在线播放| 午夜精品久久久久久久蜜桃app| 一区二区三区四区不卡在线| 1区2区3区精品视频| 中文字幕一区二区三| 国产精品女上位| 国产精品久久久久婷婷二区次| 久久久久九九视频|