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

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

?? htmlnode.java

?? java html 解析小程序,文件包很小
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/* * HTML Parser * Copyright (C) 1997 David McNicol * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 * file COPYING for more details. */package cvu.html;import java.util.Hashtable;import java.util.Vector;import java.util.Enumeration;import java.io.DataOutputStream;import java.io.IOException;/** * This class represents a single node within an HTML tree. Each node * has a name, zero or more attributes and possibly some content. Nodes * can appear within the content of other nodes. <p> * End tags do not appear since they only indicate 'end-of-content'. To * prevent the system searching for the end of standalone tags, a dynamic * list has been implemented. When the HTMLNode class is resolved * a setup method is called adding a set of default standalone tags * to the list. Standalone tags can then be added and removed dynamically * using static method calls. <p> * The list is the only way the internal code can tell * whether a tag is standalone. If a problem occurs the tree structure * would still be sound, but it would not be accurate, so while the form * of the HTML would be conserved, searches would not operate correctly. * @see HTMLTree * @author <a href="http://www.strath.ac.uk/~ras97108/">David McNicol</a> */public class HTMLNode {	private HTMLNode parent;    // Refers to this node's parent.	private String name;	    // Stores the name of the HTML node.	private AttributeList attr; // List of element's attributes.	private Vector children;    // Stores the HTML node's children.	private boolean hidden;     // True if the node is not to be printed.	/**	 * Constructs a new HTMLNode.	 * @param tag the TagToken representing the start of this node.	 * @param standalone true if the tag does not have any content.	 * @param src enumeration of tag tokens.	 */	public HTMLNode (TagToken tag, HTMLNode parent, Enumeration src) {		// Store the reference to the node's parent.		this.parent = parent;		// Set the node to be unhidden by default.		hidden = false;		// Check if the given tag is null.		if (tag != null) {			// Store the node's name.			name = tag.getName();			// Store the node's attribute list.			attr = tag.getAttributes();			// Get the node's children if needed.			if (HTMLNode.isStandalone(name))				children = null;			else				children = parseChildren(src);		} else {			// Otherwise, set the name and attributes to null.			name = null;			attr = null;			// Get the node's children from the enumeration.			children = parseChildren(src);		}	}	/**	 * Constructs a new, detached HTMLNode with the specified name.	 * @param name the name of the new node.	 */	public HTMLNode (String name) {				// Store the name of the node.			this.name = name;		// The node will have no parent till it is added to a tree.		parent = null;		// Create a new attribute list.		attr = new AttributeList();		// Create space for children if the node is not standalone.		if (HTMLNode.isStandalone(name))			children = null;		else			children = new Vector();	}	/**	 * Returns the name of this node.	 */	public String getName () {		return name;	}	/**	 * Returns the node's parent node.	 */	public HTMLNode getParent () {		return parent;	}	/**	 * Returns the node's children.	 */	public Enumeration getChildren () {		// Return nothing if the node has any children.		if (children == null) return null;		return children.elements();	}	/**	 * Returns true if the node is currently hidden.	 */	public boolean isHidden () {		return hidden;	}	/**	 * Hides the node.	 */	public void hide () {		hidden = true;	}	/**	 * "Unhides" the node.	 */	public void unhide () {		hidden = false;	}	/**	 * Returns the value of the attribute with the given name.	 * @param name the name of the attribute.	 */	public String getAttribute (String name) {				// Check that the attribute list is there.		if (attr == null) return null;		// Return the value associated with the attribute name.		return (String) attr.get(name);	}	/**	 * Returns an enumeration of attributes defined in this node.	 */	public Enumeration getAttributes () {		// Check that the attribute list has been defined.		if (attr == null) return null;		// Return an enumeration of all of the attribute names.		return attr.names();	}	/**	 * Returns an attribute with all double quote characters	 * escaped with a backslash.	 * @param name the name of the attribute.	 */	public String getQuotedAttribute (String name) {		// Check that the attribute list is there.		if (attr == null) return null;		// Return the quoted version.		return attr.getQuoted(name);	}	/**	 * Returns a string version of the attribute and its value.	 * @param name the name of the attribute.	 */	public String getAttributeToString (String name) {		// Check that the attribute list is there.		if (attr == null) return null;		// Return the string version.		return attr.toString(name);	}	/**	 * Returns a string version of the HTMLNode. If the node is 	 * currently hidden then return an empty string.	 */	public String toString () {		StringBuffer sb;  // Stores the string to be returned.		Enumeration list; // List of node's attributes or children.		// Get a new StringBuffer.		sb = new StringBuffer();		if (! hidden) {			// Write the opening of the tag.			sb.append('<');			// Write the tag's name.			sb.append(name);			// Check if there are any attributes.			if (attr != null && attr.size() > 0) {				// Print string version of the attributes.				sb.append(" " + attr);			}			// Finish off the tag.			sb.append('>');		}		// Return if the node is standalone.		if (isStandalone(name)) return sb.toString();		// Otherwise, check if the node has any children.		if (children != null && children.size() > 0) {			// Get a list of all of the children.			list = children.elements();			while (list.hasMoreElements()) {				// Get the next node from the list.				Object o = list.nextElement();								// Write it.				sb.append(o.toString());			}		}		if (! hidden) {			// Write the end tag.			sb.append("</").append(name).append(">");		}		// Return the string version.		return sb.toString();	}	/**	 * Sets the node's parent to the specified HTMLNode.	 * @param parent the new parent.	 */	public void setParent (HTMLNode parent) {		this.parent = parent;	}	/**	 * Returns true if an attribute with the given name exists.	 * @param name the name of the attribute.	 */	public boolean isAttribute (String name) {			// Check that the attribute list is there.		if (attr == null) return false;		// Check the table for an attribute with that name.		return attr.exists(name);	}	/**	 * Adds a new attribute to the node's attribute list with	 * the specified value. If the attribute already exists the	 * old value is overwritten.	 * @param name the name of the attribute.	 * @param value the value of the attribute.	 */	public void addAttribute (String name, String value) {		// Return if the attribute list is not there.		if (attr == null) return;		// Otherwise, add the name/value pair to the list.		attr.set(name, value);	}	/**	 * Adds an object to the end of this node's content	 * @param child the node to be added.	 */	public void addChild (Object child) {		// Return if the child is invalid.		if (child == null) return;		// Check that this node has no children.		if (children == null) return;		// Add the child if it is a string.		if (child instanceof String) {			children.addElement(child);			return;		}		// Add the child and set its parent if it is an HTMLNode.		if (child instanceof HTMLNode) {			children.addElement(child);			((HTMLNode) child).setParent(this);			return;		}	}	/**	 * Removes the specified HTMLNode from the current node's	 * list of children.	 * @param child the node to be removed.	 */	public void removeChild (HTMLNode child) {		// Return if the child is not defined properly		if (child == null) return;		// Return if the list of children is not defined properly.		if (children == null) return;		// Otherwise, remove the child if it is on the list.		children.removeElement(child);	}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
狠狠色狠狠色综合系列| 国产精品美女久久久久久2018 | 成人午夜电影小说| 欧美在线视频全部完| 国产网红主播福利一区二区| 午夜影院在线观看欧美| jizz一区二区| 久久综合久久久久88| 婷婷综合久久一区二区三区| 99re66热这里只有精品3直播| 26uuu另类欧美| 日日夜夜精品视频天天综合网| 91色在线porny| 国产欧美日韩麻豆91| 九色综合狠狠综合久久| 欧美日韩国产不卡| 亚洲女同ⅹxx女同tv| 成人丝袜高跟foot| 精品国产露脸精彩对白| 青青草一区二区三区| 欧美性三三影院| 亚洲欧美日韩一区二区三区在线观看| 韩国一区二区在线观看| 777午夜精品视频在线播放| 一卡二卡欧美日韩| 91在线高清观看| 国产精品亲子乱子伦xxxx裸| 国产一区二区三区免费观看| 欧美tickling网站挠脚心| 日本美女一区二区三区| 欧美日韩电影一区| 五月激情综合婷婷| 欧美亚洲国产bt| 夜夜操天天操亚洲| 色婷婷av一区二区三区软件| 亚洲天堂av一区| 91亚洲精品久久久蜜桃网站| 国产精品久久久一区麻豆最新章节| 国产另类ts人妖一区二区| 久久美女艺术照精彩视频福利播放| 久久精品免费观看| 欧美xxxx老人做受| 韩国成人在线视频| xnxx国产精品| 国产91精品露脸国语对白| 日本一区二区三区免费乱视频| 国产成人免费视频精品含羞草妖精| 久久久久久毛片| 国产高清在线观看免费不卡| 国产欧美一区二区三区在线老狼| 亚洲同性gay激情无套| 国产在线不卡视频| 国产农村妇女精品| www.一区二区| 亚洲色大成网站www久久九九| 91丨九色丨尤物| 亚洲黄色小说网站| 欧美日韩午夜影院| 日本特黄久久久高潮| 精品国产三级电影在线观看| 国内久久精品视频| 国产日韩v精品一区二区| 成人涩涩免费视频| 亚洲激情图片qvod| 欧美日韩中文字幕精品| 美腿丝袜亚洲综合| 久久久久九九视频| www.亚洲色图.com| 亚洲夂夂婷婷色拍ww47| 91精品蜜臀在线一区尤物| 久久国产生活片100| 欧美国产日韩亚洲一区| 色婷婷综合久久| 日韩电影免费一区| 久久久综合九色合综国产精品| 成人午夜视频在线| 亚洲网友自拍偷拍| 日韩欧美一区二区三区在线| 国产精品一区二区三区网站| 亚洲日本va午夜在线影院| 欧美美女一区二区在线观看| 久久99久久99精品免视看婷婷| 中文字幕乱码亚洲精品一区| 欧美怡红院视频| 激情综合网av| 亚洲欧美综合另类在线卡通| 777午夜精品视频在线播放| 国产美女精品人人做人人爽| 亚洲男同性视频| 日韩精品在线一区二区| 99久久久久免费精品国产| 偷偷要91色婷婷| 久久精品亚洲国产奇米99| 91官网在线免费观看| 国内欧美视频一区二区 | 日韩欧美中文字幕制服| 成人综合婷婷国产精品久久免费| 亚洲码国产岛国毛片在线| 日韩一级在线观看| 91在线无精精品入口| 久久国产精品99久久久久久老狼| 亚洲色图一区二区| 精品日韩av一区二区| 色综合天天综合网国产成人综合天 | 亚洲电影第三页| 26uuu国产一区二区三区| 欧洲av一区二区嗯嗯嗯啊| 国产精品一区二区久久不卡| 亚洲国产精品久久久久秋霞影院| 久久综合资源网| 欧美乱熟臀69xxxxxx| 成人国产电影网| 九九九久久久精品| 亚洲在线成人精品| 国产精品色一区二区三区| 欧美一区二区三区爱爱| 色噜噜久久综合| 国产成人亚洲综合a∨婷婷| 日本美女一区二区三区视频| 亚洲免费大片在线观看| 国产三级欧美三级| 91精品国产手机| 欧美性生活一区| 99在线热播精品免费| 国产一区二区精品在线观看| 亚洲va欧美va天堂v国产综合| 国产精品国产a| www国产精品av| 91麻豆精品国产91久久久久| 在线观看中文字幕不卡| 白白色 亚洲乱淫| 国产一区二区在线影院| 三级精品在线观看| 亚洲午夜久久久久久久久电影院| 国产精品毛片久久久久久| 26uuu久久综合| 日韩精品在线一区二区| 欧美日韩国产综合视频在线观看 | 久久国产精品99久久久久久老狼| 亚洲成av人片在www色猫咪| 亚洲欧美乱综合| 成人免费视频在线观看| 中文幕一区二区三区久久蜜桃| 久久精品一区二区三区av| 久久嫩草精品久久久精品| 26uuu精品一区二区三区四区在线 26uuu精品一区二区在线观看 | 国产精品资源在线看| 麻豆精品精品国产自在97香蕉| 亚洲aⅴ怡春院| 亚洲高清不卡在线| 亚洲午夜视频在线观看| 亚洲综合色在线| 一区二区三区欧美激情| 亚洲精品久久久蜜桃| 中文字幕亚洲综合久久菠萝蜜| 久久精品欧美日韩| 欧美一区二区福利视频| 久久国产视频网| 午夜精品福利久久久| 亚洲一二三区在线观看| 亚洲人吸女人奶水| 一区二区视频在线| 国产精品的网站| 国产精品久久国产精麻豆99网站 | 欧美亚州韩日在线看免费版国语版| 粉嫩13p一区二区三区| 国产精一区二区三区| 午夜激情久久久| 日本三级亚洲精品| 日本一不卡视频| 视频一区视频二区中文字幕| 亚洲午夜在线观看视频在线| 亚洲与欧洲av电影| 一区二区三区精品视频| 亚洲色图20p| ㊣最新国产の精品bt伙计久久| 中文字幕第一区综合| 国产精品久久久一区麻豆最新章节| 国产区在线观看成人精品| 欧美高清在线视频| 国产精品欧美经典| ...xxx性欧美| 亚洲一线二线三线视频| 日本在线不卡视频一二三区| 日本亚洲视频在线| 奇米777欧美一区二区| 日韩精品乱码免费| 国精产品一区一区三区mba桃花| 国产一区亚洲一区| 国产成人在线视频网站| 国产成人在线视频网址| 91亚洲永久精品| 欧美图区在线视频| 日韩精品一区二区三区swag| 久久嫩草精品久久久精品| 国产精品久久久久三级| 亚洲二区在线视频| 老司机精品视频导航| 国产一区二区三区电影在线观看| 国产美女一区二区|