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

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

?? dtd.java

?? JAVA的一些源碼 JAVA2 STANDARD EDITION DEVELOPMENT KIT 5.0
?? JAVA
字號:
/* * @(#)DTD.java	1.20 04/05/05 * * Copyright 2004 Sun Microsystems, Inc. All rights reserved. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */package javax.swing.text.html.parser;import java.io.PrintStream;import java.io.File;import java.io.FileInputStream;import java.io.InputStream;import java.io.IOException;import java.io.FileNotFoundException;import java.io.BufferedInputStream;import java.io.DataInputStream;import java.util.Hashtable;import java.util.Vector;import java.util.BitSet;import java.util.StringTokenizer;import java.util.Enumeration;import java.util.Properties;import java.net.URL;/** * The representation of an SGML DTD.  DTD describes a document * syntax and is used in parsing of HTML documents.  It contains * a list of elements and their attributes as well as a list of * entities defined in the DTD. * * @see Element * @see AttributeList * @see ContentModel * @see Parser * @author Arthur van Hoff * @version 1.20 05/05/04 */publicclass DTD implements DTDConstants {    public String name;    public Vector<Element> elements = new Vector<Element>();    public Hashtable<String,Element> elementHash	= new Hashtable<String,Element>();    public Hashtable<Object,Entity> entityHash	= new Hashtable<Object,Entity>();    public final Element pcdata = getElement("#pcdata");    public final Element html = getElement("html");    public final Element meta = getElement("meta");    public final Element base = getElement("base");    public final Element isindex = getElement("isindex");    public final Element head = getElement("head");    public final Element body = getElement("body");    public final Element applet = getElement("applet");    public final Element param = getElement("param");    public final Element p = getElement("p");    public final Element title = getElement("title");    final Element style = getElement("style");    final Element link = getElement("link");    final Element script = getElement("script");    public static final int FILE_VERSION = 1;    /**     * Creates a new DTD with the specified name.     * @param name the name, as a <code>String</code> of the new DTD     */    protected DTD(String name) {	this.name = name;	defEntity("#RE", GENERAL, '\r');	defEntity("#RS", GENERAL, '\n');	defEntity("#SPACE", GENERAL, ' ');	defineElement("unknown", EMPTY, false, true, null, null, null, null);    }    /**     * Gets the name of the DTD.     * @return the name of the DTD     */    public String getName() {	return name;    }    /**     * Gets an entity by name.     * @return the <code>Entity</code> corresponding to the      *   <code>name</code> <code>String</code>     */    public Entity getEntity(String name) {	return (Entity)entityHash.get(name);    }    /**     * Gets a character entity.     * @return the <code>Entity</code> corresponding to the     *    <code>ch</code> character     */    public Entity getEntity(int ch) {	return (Entity)entityHash.get(new Integer(ch));    }    /**     * Returns <code>true</code> if the element is part of the DTD,     * otherwise returns <code>false</code>.     *     * @param  name the requested <code>String</code>     * @return <code>true</code> if <code>name</code> exists as     *   part of the DTD, otherwise returns <code>false</code>     */    boolean elementExists(String name) {	Element e = (Element)elementHash.get(name);	return ((e == null) ? false : true);    }    /**     * Gets an element by name. A new element is     * created if the element doesn't exist.     *     * @param name the requested <code>String</code>     * @return the <code>Element</code> corresponding to     *   <code>name</code>, which may be newly created     */    public Element getElement(String name) {	Element e = (Element)elementHash.get(name);	if (e == null) {	    e = new Element(name, elements.size());	    elements.addElement(e);	    elementHash.put(name, e);	}	return e;    }    /**     * Gets an element by index.     *     * @param index the requested index     * @return the <code>Element</code> corresponding to     *   <code>index</code>     */    public Element getElement(int index) {	return (Element)elements.elementAt(index);    }    /**     * Defines an entity.  If the <code>Entity</code> specified     * by <code>name</code>, <code>type</code>, and <code>data</code>     * exists, it is returned; otherwise a new <code>Entity</code>     * is created and is returned.     *     * @param name the name of the <code>Entity</code> as a <code>String</code>     * @param type the type of the <code>Entity</code>     * @param data the <code>Entity</code>'s data     * @return the <code>Entity</code> requested or a new <code>Entity</code>     *   if not found     */    public Entity defineEntity(String name, int type, char data[]) {	Entity ent = (Entity)entityHash.get(name);	if (ent == null) {	    ent = new Entity(name, type, data);	    entityHash.put(name, ent);	    if (((type & GENERAL) != 0) && (data.length == 1)) {		switch (type & ~GENERAL) {		  case CDATA:		  case SDATA:		    entityHash.put(new Integer(data[0]), ent);		    break;		}	    }	}	return ent;    }    /**     * Returns the <code>Element</code> which matches the     * specified parameters.  If one doesn't exist, a new     * one is created and returned.     *     * @param name the name of the <code>Element</code>     * @param type the type of the <code>Element</code>     * @param omitStart <code>true</code if start should be omitted     * @param omitEnd  <code>true</code> if end should be omitted     * @param content  the <code>ContentModel</code>     * @param atts the <code>AttributeList</code> specifying the      *    <code>Element</code>     * @return the <code>Element</code> specified     */    public Element defineElement(String name, int type,		       boolean omitStart, boolean omitEnd, ContentModel content,		       BitSet exclusions, BitSet inclusions, AttributeList atts) {	Element e = getElement(name);	e.type = type;	e.oStart = omitStart;	e.oEnd = omitEnd;	e.content = content;	e.exclusions = exclusions;	e.inclusions = inclusions;	e.atts = atts;	return e;    }    /**     * Returns the <code>Element</code> which matches the     * specified <code>AttributeList</code>.      * If one doesn't exist, a new one is created and returned.     *     * @param name the name of the <code>Element</code>     * @param atts the <code>AttributeList</code> specifying the      *    <code>Element</code>     * @return the <code>Element</code> specified     */    public void defineAttributes(String name, AttributeList atts) {	Element e = getElement(name);	e.atts = atts;    }    /**     * Creates and returns a character <code>Entity</code>.     * @param name the entity's name     * @return the new character <code>Entity</code>     */    public Entity defEntity(String name, int type, int ch) {	char data[] = {(char)ch};	return defineEntity(name, type, data);    }    /**     * Creates and returns an <code>Entity</code>.     * @param name the entity's name     * @return the new <code>Entity</code>     */    protected Entity defEntity(String name, int type, String str) {	int len = str.length();	char data[] = new char[len];	str.getChars(0, len, data, 0);	return defineEntity(name, type, data);    }    /**     * Creates and returns an <code>Element</code>.     * @param name the element's name     * @return the new <code>Element</code>     */    protected Element defElement(String name, int type,		       boolean omitStart, boolean omitEnd, ContentModel content,		       String[] exclusions, String[] inclusions, AttributeList atts) {	BitSet excl = null;	if (exclusions != null && exclusions.length > 0) {	    excl = new BitSet();	    for (int i = 0; i < exclusions.length; i++) {		String str = exclusions[i];		if (str.length() > 0) {		    excl.set(getElement(str).getIndex());		}	    }	}	BitSet incl = null;	if (inclusions != null && inclusions.length > 0) {	    incl = new BitSet();	    for (int i = 0; i < inclusions.length; i++) {		String str = inclusions[i];		if (str.length() > 0) {		    incl.set(getElement(str).getIndex());		}	    }	}	return defineElement(name, type, omitStart, omitEnd, content, excl, incl, atts);    }    /**     * Creates and returns an <code>AttributeList</code>.     * @param name the attribute list's name     * @return the new <code>AttributeList</code>     */    protected AttributeList defAttributeList(String name, int type, int modifier, String value, String values, AttributeList atts) {	Vector vals = null;	if (values != null) {	    vals = new Vector();	    for (StringTokenizer s = new StringTokenizer(values, "|") ; s.hasMoreTokens() ;) {		String str = s.nextToken();		if (str.length() > 0) {		    vals.addElement(str);		}	    }	}	return new AttributeList(name, type, modifier, value, vals, atts);    }    /**     * Creates and returns a new content model.     * @param type the type of the new content model     * @return the new <code>ContentModel</code>     */    protected ContentModel defContentModel(int type, Object obj, ContentModel next) {	return new ContentModel(type, obj, next);    }    /**     * Returns a string representation of this DTD.     * @return the string representation of this DTD     */    public String toString() {	return name;    }    /**     * The hashtable of DTDs.     */    static Hashtable dtdHash = new Hashtable();  public static void putDTDHash(String name, DTD dtd) {    dtdHash.put(name, dtd);  }    /**     * Returns a DTD with the specified <code>name</code>.  If     * a DTD with that name doesn't exist, one is created     * and returned.  Any uppercase characters in the name     * are converted to lowercase.     *     * @param name the name of the DTD     * @return the DTD which corresponds to <code>name</code>     */    public static DTD getDTD(String name) throws IOException {	name = name.toLowerCase();	DTD dtd = (DTD)dtdHash.get(name);	if (dtd == null)	  dtd = new DTD(name);	return dtd;    }    /**     * Recreates a DTD from an archived format.     * @param in  the <code>DataInputStream</code> to read from     */    public void read(DataInputStream in) throws IOException {	if (in.readInt() != FILE_VERSION) {	}	//	// Read the list of names	//	String[] names = new String[in.readShort()];	for (int i = 0; i < names.length; i++) {	    names[i] = in.readUTF();	}	//	// Read the entities	//	int num = in.readShort();	for (int i = 0; i < num; i++) {	    short nameId = in.readShort();	    int type = in.readByte();	    String name = in.readUTF();	    defEntity(names[nameId], type | GENERAL, name);	}	// Read the elements	//	num = in.readShort();	for (int i = 0; i < num; i++) {	    short nameId = in.readShort();	    int type = in.readByte();	    byte flags = in.readByte();	    ContentModel m = readContentModel(in, names);	    String[] exclusions = readNameArray(in, names);	    String[] inclusions = readNameArray(in, names);	    AttributeList atts = readAttributeList(in, names);	    defElement(names[nameId], type,		       ((flags & 0x01) != 0), ((flags & 0x02) != 0),		       m, exclusions, inclusions, atts);	}    }    private ContentModel readContentModel(DataInputStream in, String[] names)		throws IOException {	byte flag = in.readByte();	switch(flag) {	    case 0:		// null		return null;	    case 1: {		// content_c		int type = in.readByte();		ContentModel m = readContentModel(in, names);		ContentModel next = readContentModel(in, names);		return defContentModel(type, m, next);	    }	    case 2: {		// content_e		int type = in.readByte();		Element el = getElement(names[in.readShort()]);		ContentModel next = readContentModel(in, names);		return defContentModel(type, el, next);	    }	default:		throw new IOException("bad bdtd");	}    }    private String[] readNameArray(DataInputStream in, String[] names)		throws IOException {	int num = in.readShort();	if (num == 0) {	    return null;	}	String[] result = new String[num];	for (int i = 0; i < num; i++) {	    result[i] = names[in.readShort()];	}	return result;    }    private AttributeList readAttributeList(DataInputStream in, String[] names)		throws IOException  {	AttributeList result = null;	for (int num = in.readByte(); num > 0; --num) {	    short nameId = in.readShort();	    int type = in.readByte();	    int modifier = in.readByte();	    short valueId = in.readShort();	    String value = (valueId == -1) ? null : names[valueId];	    Vector values = null;	    short numValues = in.readShort();	    if (numValues > 0) {		values = new Vector(numValues);		for (int i = 0; i < numValues; i++) {		    values.addElement(names[in.readShort()]);		}	    }result = new AttributeList(names[nameId], type, modifier, value,				       values, result);	    // We reverse the order of the linked list by doing this, but	    // that order isn't important.	}	return result;    }}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久精品人人做人人综合 | 久久成人免费网站| 中文一区二区在线观看| 欧美日韩久久一区二区| 成人精品视频网站| 美女一区二区久久| 亚洲综合在线五月| 中文字幕 久热精品 视频在线| 911国产精品| 91国偷自产一区二区三区观看| 国产精品99久久久久久久女警| 日本一区中文字幕| 亚洲一卡二卡三卡四卡五卡| 欧美国产亚洲另类动漫| 久久午夜羞羞影院免费观看| 欧美精品 日韩| 欧美性一级生活| 91蜜桃婷婷狠狠久久综合9色| 黄色日韩网站视频| 美腿丝袜亚洲色图| 日韩精品亚洲一区二区三区免费| 一区二区三区中文字幕| 国产精品久久久一区麻豆最新章节| 日韩精品资源二区在线| 91麻豆精品国产自产在线观看一区| 91国偷自产一区二区使用方法| 日韩欧美一区二区免费| 欧美亚洲综合一区| 欧美中文字幕一二三区视频| 日本韩国精品一区二区在线观看| 成人性视频网站| 国产精品一区二区三区四区| 久久99九九99精品| 麻豆国产精品777777在线| 天天av天天翘天天综合网色鬼国产| 亚洲国产精品一区二区尤物区| 一二三区精品福利视频| 亚洲国产成人av网| 日本在线不卡视频| 日韩黄色片在线观看| 丝袜诱惑制服诱惑色一区在线观看 | 91丨porny丨最新| 91丨porny丨最新| 在线观看欧美黄色| 欧美精品一卡两卡| 日韩女优制服丝袜电影| 精品捆绑美女sm三区| 久久网这里都是精品| 亚洲国产岛国毛片在线| 国产精品久久久久久久久快鸭| 亚洲欧洲精品一区二区三区不卡 | 裸体歌舞表演一区二区| 久久99久久久久久久久久久| 国模无码大尺度一区二区三区| 国产精品一区免费在线观看| 成人v精品蜜桃久久一区| 91在线小视频| 欧美精品久久一区| 久久先锋资源网| 亚洲人成网站在线| 日韩国产欧美在线视频| 狠狠色伊人亚洲综合成人| 成人a区在线观看| 欧洲一区在线观看| 日韩欧美在线综合网| 久久丝袜美腿综合| 亚洲人精品一区| 日韩福利电影在线观看| 国产99久久久精品| 欧美视频精品在线| 久久亚洲精品国产精品紫薇| 亚洲免费三区一区二区| 青青草视频一区| 99久久精品免费精品国产| 欧美日韩性生活| 国产欧美中文在线| 婷婷开心激情综合| 国产成人精品影视| 欧美精品日韩综合在线| 亚洲国产精品成人综合色在线婷婷 | 亚洲va韩国va欧美va精品| 国内国产精品久久| 色久综合一二码| 精品粉嫩aⅴ一区二区三区四区| 一区二区中文视频| 美女视频黄 久久| 精品国产亚洲在线| 亚洲人成7777| 韩国欧美一区二区| 欧美色精品在线视频| 国产精品午夜免费| 奇米影视一区二区三区| 色婷婷综合中文久久一本| 久久这里只有精品首页| 日韩国产一二三区| 色网站国产精品| 日本一区二区免费在线观看视频 | 国产精品视频你懂的| 热久久一区二区| 欧美在线观看视频在线| 国产亚洲人成网站| 美女一区二区久久| 欧美日韩aaaaaa| 亚洲男人天堂av网| 成人av网在线| 久久美女高清视频| 久久电影网电视剧免费观看| 欧美人与z0zoxxxx视频| 一区二区三区国产| 99免费精品视频| 国产欧美日韩精品一区| 久久99精品国产麻豆婷婷| 欧美老肥妇做.爰bbww| 夜夜嗨av一区二区三区网页| 豆国产96在线|亚洲| 精品国产乱码久久久久久久 | 国产精品一级在线| 精品sm捆绑视频| 免费在线观看视频一区| 91麻豆精品国产91久久久久久 | 国产精品全国免费观看高清| 国产乱妇无码大片在线观看| 精品久久久三级丝袜| 亚洲777理论| 欧美人成免费网站| 亚洲成人av福利| 7777精品伊人久久久大香线蕉的| 一区二区三区免费观看| 欧美制服丝袜第一页| 一区二区免费在线播放| 欧美综合欧美视频| 午夜影院久久久| 91麻豆精品国产91久久久久久久久| 丝袜国产日韩另类美女| 91麻豆精品国产91久久久久| 日韩精品电影在线| 欧美成人综合网站| 国产一区二区三区综合| 国产婷婷色一区二区三区在线| 国产老妇另类xxxxx| 国产日产欧美一区二区视频| 国产成人av资源| 亚洲视频在线观看一区| 99久久99久久免费精品蜜臀| 一区二区三区在线观看动漫| 在线一区二区三区做爰视频网站| 亚洲夂夂婷婷色拍ww47| 欧美一级夜夜爽| 国产精品夜夜爽| 成人欧美一区二区三区在线播放| 99久久精品免费看国产| 亚洲一区二区综合| 日韩一区二区免费电影| 国产黑丝在线一区二区三区| 亚洲欧美在线高清| 欧美日韩亚洲丝袜制服| 国内一区二区视频| 综合久久久久综合| 欧美日本一区二区在线观看| 狠狠色丁香久久婷婷综合_中| 国产欧美一二三区| 欧洲精品视频在线观看| 美国欧美日韩国产在线播放| 国产日产欧美一区二区三区| 色婷婷一区二区三区四区| 午夜电影一区二区| 香蕉成人伊视频在线观看| 日韩视频一区在线观看| 成人app在线观看| 亚洲最大成人综合| 精品成人在线观看| 色综合天天综合色综合av| 日本中文一区二区三区| 国产精品久久免费看| 欧美日本韩国一区| 成人小视频在线观看| 午夜视频在线观看一区二区 | 久久精品国产精品青草| 国产精品视频在线看| 欧美日韩中文另类| 国产福利精品一区二区| 一区二区三区欧美激情| 久久免费视频色| 777久久久精品| www.激情成人| 韩国视频一区二区| 午夜欧美在线一二页| 国产精品护士白丝一区av| 日韩一区二区免费在线电影| 91丝袜高跟美女视频| 激情综合网av| 亚洲五月六月丁香激情| 国产欧美一区二区精品性色 | 极品少妇一区二区| 亚洲一区免费观看| 国产精品每日更新| 26uuu国产电影一区二区| 欧美手机在线视频| 91在线无精精品入口| 成人综合激情网|