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

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

?? documentparser.java

?? JAVA的一些源碼 JAVA2 STANDARD EDITION DEVELOPMENT KIT 5.0
?? JAVA
字號:
/* * @(#)DocumentParser.java	1.28 03/12/19 * * Copyright 2004 Sun Microsystems, Inc. All rights reserved. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */package javax.swing.text.html.parser;import javax.swing.text.SimpleAttributeSet;import javax.swing.text.html.HTMLEditorKit;import javax.swing.text.html.HTML;import javax.swing.text.ChangedCharSetException;import java.util.*;import java.io.*;import java.net.*;/** * A Parser for HTML Documents (actually, you can specify a DTD, but * you should really only use this class with the html dtd in swing). * Reads an InputStream of HTML and * invokes the appropriate methods in the ParserCallback class. This * is the default parser used by HTMLEditorKit to parse HTML url's. * <p>This will message the callback for all valid tags, as well as * tags that are implied but not explicitly specified. For example, the * html string (&lt;p&gt;blah) only has a p tag defined. The callback * will see the following methods: * <ol><li><i>handleStartTag(html, ...)</i></li> *     <li><i>handleStartTag(head, ...)</i></li> *     <li><i>handleEndTag(head)</i></li> *     <li><i>handleStartTag(body, ...)</i></li> *     <li>handleStartTag(p, ...)</i></li> *     <li>handleText(...)</li> *     <li><i>handleEndTag(p)</i></li> *     <li><i>handleEndTag(body)</i></li> *     <li><i>handleEndTag(html)</i></li> * </ol> * The items in <i>italic</i> are implied, that is, although they were not * explicitly specified, to be correct html they should have been present * (head isn't necessary, but it is still generated). For tags that * are implied, the AttributeSet argument will have a value of * <code>Boolean.TRUE</code> for the key * <code>HTMLEditorKit.ParserCallback.IMPLIED</code>. * <p>HTML.Attributes defines a type safe enumeration of html attributes. * If an attribute key of a tag is defined in HTML.Attribute, the * HTML.Attribute will be used as the key, otherwise a String will be used. * For example &lt;p foo=bar class=neat&gt; has two attributes. foo is * not defined in HTML.Attribute, where as class is, therefore the * AttributeSet will have two values in it, HTML.Attribute.CLASS with * a String value of 'neat' and the String key 'foo' with a String value of * 'bar'. * <p>The position argument will indicate the start of the tag, comment * or text. Similiar to arrays, the first character in the stream has a * position of 0. For tags that are * implied the position will indicate * the location of the next encountered tag. In the first example, * the implied start body and html tags will have the same position as the * p tag, and the implied end p, html and body tags will all have the same * position. * <p>As html skips whitespace the position for text will be the position * of the first valid character, eg in the string '\n\n\nblah' * the text 'blah' will have a position of 3, the newlines are skipped. * <p> * For attributes that do not have a value, eg in the html * string <code>&lt;foo blah&gt;</code> the attribute <code>blah</code> * does not have a value, there are two possible values that will be * placed in the AttributeSet's value: * <ul> * <li>If the DTD does not contain an definition for the element, or the *     definition does not have an explicit value then the value in the *     AttributeSet will be <code>HTML.NULL_ATTRIBUTE_VALUE</code>. * <li>If the DTD contains an explicit value, as in: *     <code>&lt;!ATTLIST OPTION selected (selected) #IMPLIED&gt;</code> *     this value from the dtd (in this case selected) will be used. * </ul> * <p> * Once the stream has been parsed, the callback is notified of the most * likely end of line string. The end of line string will be one of * \n, \r or \r\n, which ever is encountered the most in parsing the * stream. * * @version 	1.28 12/19/03 * @author      Sunita Mani */public class DocumentParser extends javax.swing.text.html.parser.Parser {    private int inbody;    private int intitle;    private int inhead;    private int instyle;    private int inscript;    private boolean seentitle;    private HTMLEditorKit.ParserCallback callback = null;    private boolean ignoreCharSet = false;    private static final boolean debugFlag = false;    public DocumentParser(DTD dtd) {	super(dtd);    }     public void parse(Reader in,  HTMLEditorKit.ParserCallback callback, boolean ignoreCharSet) throws IOException {	this.ignoreCharSet = ignoreCharSet;	this.callback = callback;	parse(in);	// end of line	callback.handleEndOfLineString(getEndOfLineString());    }    /**     * Handle Start Tag.     */    protected void handleStartTag(TagElement tag) {	Element elem = tag.getElement();	if (elem == dtd.body) {	    inbody++;	} else if (elem == dtd.html) {	} else if (elem == dtd.head) {	    inhead++;	} else if (elem == dtd.title) {	    intitle++;	} else if (elem == dtd.style) {	    instyle++;	} else if (elem == dtd.script) {            inscript++;	}		if (debugFlag) {	    if (tag.fictional()) {		debug("Start Tag: " + tag.getHTMLTag() + " pos: " + getCurrentPos());	    } else {		debug("Start Tag: " + tag.getHTMLTag() + " attributes: " + 		      getAttributes() + " pos: " + getCurrentPos());	    }	}	if (tag.fictional()) {	    SimpleAttributeSet attrs = new SimpleAttributeSet();	    attrs.addAttribute(HTMLEditorKit.ParserCallback.IMPLIED,			       Boolean.TRUE);	    callback.handleStartTag(tag.getHTMLTag(), attrs,				    getBlockStartPosition());	} else {	    callback.handleStartTag(tag.getHTMLTag(), getAttributes(),				    getBlockStartPosition());	    flushAttributes();	}    }    protected void handleComment(char text[]) {	if (debugFlag) {	    debug("comment: ->" + new String(text) + "<-"		  + " pos: " + getCurrentPos());	}	callback.handleComment(text, getBlockStartPosition());    }    /**     * Handle Empty Tag.     */    protected void handleEmptyTag(TagElement tag) throws ChangedCharSetException {	Element elem = tag.getElement();	if (elem == dtd.meta && !ignoreCharSet) {	    SimpleAttributeSet atts = getAttributes();	    if (atts != null) {		String content = (String)atts.getAttribute(HTML.Attribute.CONTENT);		if (content != null) {		    if ("content-type".equalsIgnoreCase((String)atts.getAttribute(HTML.Attribute.HTTPEQUIV))) {			if (!content.equalsIgnoreCase("text/html") && 				!content.equalsIgnoreCase("text/plain")) {			    throw new ChangedCharSetException(content, false);			}		    } else if ("charset" .equalsIgnoreCase((String)atts.getAttribute(HTML.Attribute.HTTPEQUIV))) {			throw new ChangedCharSetException(content, true);		    }		}	    }	}	if (inbody != 0 || elem == dtd.meta || elem == dtd.base || elem == dtd.isindex || elem == dtd.style || elem == dtd.link) {	    if (debugFlag) {		if (tag.fictional()) {		    debug("Empty Tag: " + tag.getHTMLTag() + " pos: " + getCurrentPos());		} else {		    debug("Empty Tag: " + tag.getHTMLTag() + " attributes: " 			  + getAttributes() + " pos: " + getCurrentPos());		}	    }	    if (tag.fictional()) {		SimpleAttributeSet attrs = new SimpleAttributeSet();		attrs.addAttribute(HTMLEditorKit.ParserCallback.IMPLIED,				   Boolean.TRUE);		callback.handleSimpleTag(tag.getHTMLTag(), attrs,					 getBlockStartPosition());	    } else {		callback.handleSimpleTag(tag.getHTMLTag(), getAttributes(),					 getBlockStartPosition());		flushAttributes();	    }	}    }    /**     * Handle End Tag.     */    protected void handleEndTag(TagElement tag) {	Element elem = tag.getElement();	if (elem == dtd.body) {	    inbody--;	} else if (elem == dtd.title) {	    intitle--;	    seentitle = true;	} else if (elem == dtd.head) {            inhead--;	} else if (elem == dtd.style) {            instyle--;	} else if (elem == dtd.script) {            inscript--;	}	if (debugFlag) {	    debug("End Tag: " + tag.getHTMLTag() + " pos: " + getCurrentPos());	}	callback.handleEndTag(tag.getHTMLTag(), getBlockStartPosition());    }    /**     * Handle Text.     */    protected void handleText(char data[]) {	if (data != null) {	    if (inscript != 0) {		callback.handleComment(data, getBlockStartPosition());		return;	    }	    if (inbody != 0 || ((instyle != 0) ||				((intitle != 0) && !seentitle))) {		if (debugFlag) {		    debug("text:  ->" + new String(data) + "<-" + " pos: " + getCurrentPos());		}		callback.handleText(data, getBlockStartPosition());	    }	}    }    /*     * Error handling.     */    protected void handleError(int ln, String errorMsg) {	if (debugFlag) {	    debug("Error: ->" + errorMsg + "<-" + " pos: " + getCurrentPos());	}	/* PENDING: need to improve the error string. */	callback.handleError(errorMsg, getCurrentPos());    }    /*     * debug messages     */    private void debug(String msg) {	System.out.println(msg);    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
4438x成人网最大色成网站| 中文无字幕一区二区三区| 欧美一区二区高清| 中文字幕亚洲欧美在线不卡| 日日摸夜夜添夜夜添国产精品| 成人av网站免费观看| 精品久久久久久久人人人人传媒 | 欧洲精品在线观看| 国产亚洲欧美日韩俺去了| 日本视频一区二区| 在线观看日韩国产| 中文字幕在线观看不卡| 国产宾馆实践打屁股91| 精品sm捆绑视频| 青青草国产精品亚洲专区无| 欧美亚洲高清一区| 亚洲国产欧美另类丝袜| 色悠悠亚洲一区二区| 欧美激情中文字幕| 国产福利电影一区二区三区| 精品国产乱码久久| 另类小说图片综合网| 这里是久久伊人| 日韩高清不卡一区二区三区| 在线视频综合导航| 亚洲国产精品精华液网站| 欧美体内she精视频| 亚洲美女电影在线| 日本福利一区二区| 亚洲一区二区三区美女| 欧美少妇性性性| 一区二区三区在线视频观看58| 99国产麻豆精品| 中文字幕欧美一| 色综合久久99| 亚洲va天堂va国产va久| 制服丝袜一区二区三区| 日本在线不卡视频| 欧美videos中文字幕| 国内精品免费在线观看| 久久久亚洲精华液精华液精华液| 激情五月婷婷综合| 精品88久久久久88久久久| 国产精品一区二区久激情瑜伽| 国产午夜亚洲精品理论片色戒 | 午夜久久久久久电影| 欧美三级电影在线看| 五月天久久比比资源色| 日韩视频在线你懂得| 国产福利精品导航| 亚洲欧洲性图库| 欧美日韩日日摸| 老司机精品视频在线| 国产农村妇女精品| 色狠狠桃花综合| 国产成人啪午夜精品网站男同| 欧美—级在线免费片| 一本高清dvd不卡在线观看| 午夜精品福利一区二区蜜股av | 欧美性一区二区| 日本女人一区二区三区| 国产欧美一区二区精品性色| www.成人在线| 蜜臀a∨国产成人精品| 亚洲国产精品t66y| 精品视频1区2区| 国产精品一区二区不卡| 一区二区在线电影| 精品国产91亚洲一区二区三区婷婷| 国产91丝袜在线播放九色| 亚洲综合一区在线| 久久久久免费观看| 4438x亚洲最大成人网| 不卡的av中国片| 日本不卡在线视频| 亚洲男人天堂av| ww亚洲ww在线观看国产| 在线观看免费视频综合| 国产一区二区看久久| 亚洲一区二区三区四区不卡| 精品国产不卡一区二区三区| 在线观看成人小视频| 国产v综合v亚洲欧| 强制捆绑调教一区二区| 一区二区在线电影| 国产精品久久久久一区二区三区 | 亚洲一二三专区| 中文字幕不卡三区| 日韩精品在线看片z| 在线观看亚洲一区| 99久久久久久99| 成人夜色视频网站在线观看| 免费高清在线视频一区·| 亚洲一区在线视频| 亚洲乱码中文字幕综合| 国产精品成人在线观看| 国产精品免费久久久久| 欧美精品一区二区三区蜜桃| 欧美精品1区2区3区| 色婷婷精品久久二区二区蜜臂av| 韩国精品免费视频| 精品一区二区三区免费毛片爱| 亚洲高清三级视频| 亚洲福利视频一区| 亚洲一级不卡视频| 亚洲午夜久久久| 亚洲一区在线观看免费观看电影高清 | 99久久精品免费| 成人久久久精品乱码一区二区三区 | 亚洲成人激情自拍| 一区二区三区日韩精品| 伊人开心综合网| 亚洲精品国久久99热| 亚洲欧美经典视频| 亚洲高清视频的网址| 丝袜美腿亚洲一区二区图片| 亚洲第一av色| 免费在线看成人av| 精品一区二区日韩| 国产成人免费视频一区| 不卡视频在线看| 在线日韩一区二区| 欧美日韩国产在线播放网站| 91官网在线观看| 91精品国产乱| 久久久久高清精品| 国产精品盗摄一区二区三区| 亚洲视频免费在线观看| 一区二区高清免费观看影视大全| 亚洲精品国产无套在线观| 亚洲自拍欧美精品| 日韩国产成人精品| 国产毛片精品一区| 99久久精品国产网站| 欧美日韩国产a| 精品国产凹凸成av人网站| 亚洲国产精品传媒在线观看| 一区二区在线看| 日本成人中文字幕| 国产成人8x视频一区二区| 91色porny在线视频| 欧美日韩aaa| 国产亚洲欧洲一区高清在线观看| 亚洲欧洲一区二区在线播放| 午夜视黄欧洲亚洲| 韩国av一区二区| 一本大道av伊人久久综合| 4438成人网| 中文字幕一区二区三区四区不卡| 亚洲国产视频直播| 国产一区二区三区四区五区美女 | 日韩一区二区三区在线观看 | jizzjizzjizz欧美| 欧美男同性恋视频网站| 国产视频一区在线观看| 午夜伦欧美伦电影理论片| 国产盗摄一区二区| 91精品久久久久久蜜臀| 中文字幕中文字幕一区| 喷水一区二区三区| 在线精品视频一区二区| 欧美mv日韩mv国产| 亚洲国产精品一区二区www在线| 激情偷乱视频一区二区三区| 日本乱人伦一区| 久久久精品人体av艺术| 香蕉成人伊视频在线观看| 丰满亚洲少妇av| 欧美一区二区免费| 亚洲欧美另类久久久精品| 国产在线观看一区二区| 欧美剧在线免费观看网站| 亚洲视频在线观看一区| 国产一区 二区 三区一级| 在线综合+亚洲+欧美中文字幕| 亚洲欧洲精品一区二区三区 | 韩国精品一区二区| 91精品国产综合久久香蕉的特点| 中文字幕在线观看一区| 国产成人亚洲综合a∨婷婷| 日韩欧美第一区| 青青草国产精品97视觉盛宴| 欧美色中文字幕| 亚洲自拍另类综合| 欧美伊人久久久久久久久影院 | 666欧美在线视频| 一区二区三区四区视频精品免费 | 亚洲午夜三级在线| 在线免费观看一区| 亚洲精品久久久蜜桃| 91免费观看视频在线| 中文字幕永久在线不卡| 不卡av电影在线播放| 国产精品成人网| 99精品在线观看视频| 综合在线观看色| 日本乱码高清不卡字幕| 亚洲一区二区在线观看视频| 欧美在线高清视频| 五月激情综合网|