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

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

?? tagtoken.java

?? java html 解析小程序,文件包很小
?? JAVA
字號:
/* * 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;/** * This represents a single HTML tag. Each TagToken has a name and a * list of attributes and values. * @see HTMLTokenizer * @author <a href="http://www.strath.ac.uk/~ras97108/">David McNicol</a> */public class TagToken {	/** Identifies the escape character. */	public static final char ESCAPE = '\\';	/** Identifies the quotation character. */	public static final char QUOTE = '"';	/** Stores the name of the TagToken. */	private String name;		/** Indicates whether the TagToken is an end-token. */	private boolean end = false;	/** Stores a list of attributes and their values. */	private AttributeList attr;	/**	 * Constructs a new TagToken converting the specified string	 * into a token name and a list of attributes with values.	 * @param line the raw data.	 */	public TagToken (String line) {		name = null;		attr = new AttributeList();		tokenizeAttributes(line);	}	/**	 * Returns the name of the TagToken.	 */	public String getName () {		return name;	}	/**	 * Returns the attribute list of the TagToken.	 */	public AttributeList getAttributes () {		return attr;	}	/**	 * Indicates whether this token is an end tag.	 */	public boolean isEndTag () {		return end;	}	/**	 * Returns true if the given attribute exists.	 * @param name the name of the attribute.	 */	public boolean isAttribute (String name) {		return attr.exists(name);	}	/**	 * Returns the value of the specified attribute or null if the	 * attribute does not exist.	 * @param name the name of the attribute.	 */	public String getAttribute (String name) {		return attr.get(name);	}	/**	 * 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 TagToken.	 */	public String toString () {		StringBuffer sb;  // Stores the string to be returned.		Enumeration list; // List of node's arguments or children.		// Get a new StringBuffer.		sb = new StringBuffer();		// Write the opening of the tag.		if (end)			sb.append("</" + name);		else			sb.append('<' + name);		// Check if there are any attributes.		if (attr != null && attr.size() > 0) {			// Print string version of the attributes.			sb.append(' ').append(attr.toString());		}		// Finish off the tag.		sb.append('>');		// Return the string version.		return sb.toString();	}	/**	 * Sets the name of the token and also whether it is a begin	 * or an end token.	 * @param name the name of the token.	 */	private void setName (String name) {		if (name == null) {			this.name = null;			return;		}		String lcname = name.toLowerCase();		if (lcname.length() > 0 && lcname.charAt(0) == '/') {			this.name = lcname.substring(1);			end = true;		} else {			this.name = lcname;		}	}	/**	 * Adds a attribute and value to the list. 	 * @param name the name of the attribute.	 * @param value the value of the attribute.	 */	private void setAttribute (String name, String value) {		attr.set(name, value);	}	/**	 * Adds a attribute to the list using the given string. The string	 * may either be in the form 'attribute' or 'attribute=value'.	 * @param s contains the attribute information. 	 */	private void setAttribute (String s) {		int idx;	// The index of the = sign in the string.		String name;	// Stores the name of the attribute.		String value;	// Stores the value of the attribute.		// Check if the string is null.		if (s == null) return; 		// Get the index of = within the string.		idx = s.indexOf('=');		// Check if there was '=' character present.		if (idx < 0) {			// If not, add the whole string as the attribute			// name with a null value.			setAttribute(s, "");		} else {			// If so, split the string into a name and value.			name = s.substring(0, idx);			value = s.substring(idx + 1);					// Add the name and value to the attribute list.			setAttribute(name, value);		}	}	/**	 * Tokenizes the given string and uses the resulting vector	 * to to build up the TagToken's attribute list.	 * @param args the string to tokenize.	 */	private void tokenizeAttributes (String args) {		Vector v;		// Vector of tokens from the string.		Enumeration e;		// Enumeration of vector elements.		String[] tokens = null;	// Array of tokens from vector.		int length;		// Size of the vector.		int i;			// Loop variable.		// Get the vector of tokens.		v = tokenizeString(args);		// Check it is not null.		if (v == null) return;		// Create a new String array.		length = v.size() - 1;		if (length > 0) tokens = new String[length];		// Get an enumeration of the vector's elements.		e = v.elements();		// Store the first element as the TagToken's name.		setName((String) e.nextElement());		// Stop processing now if there are no more elements.		if (! e.hasMoreElements()) return;		// Put the rest of the elements into the string array.		i = 0;		while (e.hasMoreElements())			tokens[i++] = (String) e.nextElement();				// Deal with the name/value pairs with separate = signs.		for (i = 1; i < (length - 1); i++) {			if (tokens[i] == null) continue;			if (tokens[i].equals("=")) {				setAttribute(tokens[i - 1], tokens[i + 1]);				tokens[i] = null;				tokens[i - 1] = null;				tokens[i + 1] = null;			}		}		// Deal with lone attributes and joined name/value pairs.		for (i = 0; i < length; i++)			if (tokens[i] != null) setAttribute(tokens[i]);	}	/**	 * This method tokenizes the given string and returns a vector	 * of its constituent tokens. It understands quoting and character	 * escapes.	 * @param s the string to tokenize.	 */	private Vector tokenizeString (String s) {		// First check that the args are not null or zero-length.		if (s == null || s.length() == 0) return null;		boolean whitespace = false; // True if we are reading w/space.		boolean escaped = false;    // True if next char is escaped.		boolean quoted = false;	    // True if we are in quotes.		int length;		    // Length of attribute string.		int i = 0;		    // Loop variable.		// Create a vector to store the complete tokens.		Vector tokens = new Vector();		// Create a buffer to store an individual token.		StringBuffer buffer = new StringBuffer(80);		// Convert the String to a character array;		char[] array = s.toCharArray();		length = array.length;		// Loop over the character array.		while (i < length) {			// Check if we are currently removing whitespace.			if (whitespace) {				if (isWhitespace(array[i])) {					i++;					continue;				} else {					whitespace = false;				}			}			// Check if we are currently escaped.			if (escaped) {				// Add the next character to the array.				buffer.append(array[i++]);				// Turn off the character escape.				escaped = false;				continue;			} else {				// Check for the escape character.				if (array[i] == ESCAPE) {					escaped = true;					i++;					continue;				}				// Check for the quotation character.				if (array[i] == QUOTE) {					quoted = !quoted;					i++;					continue;				}				// Check for the end of the token.				if (!quoted && isWhitespace(array[i])) {					// Add the token and refresh the buffer.					tokens.addElement(buffer.toString());					buffer = new StringBuffer(80);					// Stop reading the token.					whitespace = true;					continue;				}				// Otherwise add the character to the buffer.				buffer.append(array[i++]);			}		}		// Add the last token to the vector if there is one.		if (! whitespace) tokens.addElement(buffer.toString());		return tokens;	}	/**	 * Returns true if the given character is considered to be	 * whitespace.	 * @param c the character to test.	 */	private boolean isWhitespace (char c) {		return (c == ' ' || c == '\t' || c == '\n');	}}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
k8久久久一区二区三区| 国产精品一二三| 欧美高清精品3d| 无码av免费一区二区三区试看 | 久久久蜜臀国产一区二区| 国模冰冰炮一区二区| 欧美激情在线免费观看| 99热精品一区二区| 午夜成人免费视频| 久久久久久久免费视频了| 国产91色综合久久免费分享| 日韩美女久久久| 欧美高清视频www夜色资源网| 精品一区二区国语对白| 国产精品―色哟哟| 在线观看国产一区二区| 久久超碰97中文字幕| 国产精品美女久久久久久久网站| 欧美视频日韩视频| 国产一区二区三区在线观看精品| 亚洲1区2区3区4区| 欧美一级一级性生活免费录像| 国内外精品视频| 一区二区三区丝袜| 久久婷婷国产综合国色天香| av在线播放一区二区三区| 日一区二区三区| 国产精品视频线看| 日韩一区二区免费高清| 91在线视频观看| 美女性感视频久久| 一区二区三区四区五区视频在线观看| 日韩欧美一区二区久久婷婷| 色综合久久综合| 韩国v欧美v日本v亚洲v| 亚洲成精国产精品女| 国产欧美日韩在线观看| 欧美日韩国产在线观看| 成人av网在线| 九九精品视频在线看| 亚洲成在人线免费| 自拍偷自拍亚洲精品播放| 2024国产精品视频| 欧美精品99久久久**| 色婷婷精品大在线视频| 国产精品69久久久久水密桃| 日韩av一区二区在线影视| 亚洲蜜臀av乱码久久精品| 久久日一线二线三线suv| 欧美日本国产视频| 色哟哟日韩精品| 不卡的看片网站| 国产麻豆精品久久一二三| 日韩精品久久久久久| 一区二区三区蜜桃网| 久久先锋影音av鲁色资源网| 欧美电影一区二区| 欧美日韩视频第一区| 色欧美片视频在线观看 | 亚洲欧洲日韩一区二区三区| 日韩免费性生活视频播放| 欧美人与禽zozo性伦| 欧美一a一片一级一片| 91成人在线观看喷潮| 成人app网站| 99久久国产综合色|国产精品| 国产91精品在线观看| 国产一区二区三区视频在线播放| 日韩va欧美va亚洲va久久| 亚洲亚洲人成综合网络| 伊人色综合久久天天人手人婷| 亚洲视频狠狠干| 亚洲欧美成aⅴ人在线观看| 18涩涩午夜精品.www| 亚洲色欲色欲www| 亚洲精品免费看| 亚洲欧美一区二区久久 | 欧美美女视频在线观看| 欧美日韩在线播放| 91精品国产综合久久婷婷香蕉| 3d动漫精品啪啪一区二区竹菊| 欧美日韩小视频| 日韩欧美在线123| 精品国产乱码久久久久久老虎 | 欧美日韩dvd在线观看| 欧美日韩三级在线| 欧美一区二区视频免费观看| 日韩视频在线观看一区二区| 日韩欧美aaaaaa| 国产偷v国产偷v亚洲高清| 国产精品色一区二区三区| 亚洲丝袜自拍清纯另类| 亚洲一本大道在线| 久久se这里有精品| 成人一级视频在线观看| 日本高清不卡视频| 欧美一级日韩免费不卡| 亚洲精品一区二区三区99| 国产精品色呦呦| 亚洲第一精品在线| 国产一区二区三区综合| 91免费看`日韩一区二区| 欧美精三区欧美精三区| 精品国产精品网麻豆系列| 国产精品久久久久久久久果冻传媒 | 国产精品免费视频观看| 亚洲欧美经典视频| 日韩av电影免费观看高清完整版 | 一区视频在线播放| 午夜不卡av免费| 国产一区二区三区视频在线播放| 97久久超碰国产精品| 欧美一区二区视频观看视频| 国产精品三级av| 日韩精品欧美精品| 成人一级黄色片| 51精品国自产在线| 国产精品国产精品国产专区不蜜 | 亚洲影院免费观看| 经典三级一区二区| 在线免费不卡视频| 久久精品无码一区二区三区| 亚洲国产日日夜夜| 国产91露脸合集magnet| 欧美一区二区三区影视| 中文字幕精品—区二区四季| 日本美女视频一区二区| 91免费看`日韩一区二区| 精品少妇一区二区三区在线视频| 亚洲品质自拍视频| 国产精品亚洲综合一区在线观看| 欧美色图天堂网| 欧美韩国日本不卡| 不卡视频在线看| 五月天中文字幕一区二区| 一区二区在线观看视频| 激情综合色丁香一区二区| 色国产精品一区在线观看| 国产精品网友自拍| 韩国成人在线视频| 欧美一区二区三区的| 亚洲午夜激情网站| 99精品在线观看视频| 久久久午夜精品理论片中文字幕| 日韩在线卡一卡二| 色综合久久久久久久久久久| 亚洲国产岛国毛片在线| 激情六月婷婷久久| 欧美一区二区三区系列电影| 一区二区国产视频| 成人h动漫精品一区二区| 亚洲精品在线免费播放| 亚州成人在线电影| 欧美三级在线视频| 一区二区三区四区av| 色老汉av一区二区三区| 亚洲天堂成人在线观看| aaa欧美色吧激情视频| 欧美极品美女视频| 国产**成人网毛片九色| 一本色道综合亚洲| 日韩欧美成人一区| 日本vs亚洲vs韩国一区三区二区 | 欧美一区二区三区思思人| 亚洲一区二区在线免费看| 色悠悠亚洲一区二区| 最新国产精品久久精品| 懂色av一区二区在线播放| 国产欧美日韩综合| 国产91精品在线观看| 国产精品久久久久久久裸模| 91视频免费播放| 亚洲精品免费一二三区| 欧洲亚洲国产日韩| 亚洲第一二三四区| 日韩欧美自拍偷拍| 国产在线不卡一区| 国产精品国产三级国产专播品爱网| 东方欧美亚洲色图在线| 亚洲欧美自拍偷拍| 日本久久一区二区| 午夜久久久影院| 日韩欧美黄色影院| 国产精品一区二区你懂的| 中文字幕一区二| 91国产免费看| 日韩av高清在线观看| 久久综合国产精品| 91在线播放网址| 性做久久久久久| 久久精品网站免费观看| 91啪亚洲精品| 日韩主播视频在线| 久久综合九色综合久久久精品综合| 成人精品一区二区三区四区 | 欧美亚洲国产一区二区三区| 日韩国产欧美三级| 久久精品在这里| 在线观看欧美日本| 激情五月播播久久久精品|