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

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

?? tokenrepository.java~1~

?? jwap 協議 udp 可以用于手機通訊
?? JAVA~1~
字號:
/** * JWAP - A Java Implementation of the WAP Protocols * Copyright (C) 2001-2004 Niko Bender * * 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 net.sourceforge.jwap.util.wbxml;/** * * @author <a href="mailto:suvarna@witscale.com">Suvarna Kadam</a> */import java.io.FileInputStream;import java.io.FileNotFoundException;import java.io.IOException;import java.util.Hashtable;import java.util.Iterator;import java.util.Map;import java.util.Properties;import java.util.Vector;import javax.xml.parsers.DocumentBuilderFactory;import org.w3c.dom.Document;import org.w3c.dom.Element;import org.w3c.dom.NodeList;public class TokenRepository {	private static Properties urnMappings;	private static TokenRepository instance;	private static byte CODEPAGE_DEFAULT = (byte) 0;	private static byte currentCodepage = CODEPAGE_DEFAULT;	//	private byte wbxmlEncoding;	//	private byte charEncoding;	//	private String publicID;	private Document tokenDoc;	//	private Hashtable tags;	//	private Hashtable attributeNames;	//private Hashtable attributeNameTokens; // for decoder	//	private Hashtable attributeValues;	//	private Hashtable attributePrefixes;	private Hashtable[][] codepages;	private TokenRepository() {	}	public static TokenRepository getInstance(String publicIDInHex) {		if (instance == null) {			instance = new TokenRepository();			instance.initializeFor(publicIDInHex);		}		return instance;	}	public void initializeFor(String publicIDInHex) {		try {			Properties tokenRepositoryMappings = new Properties();			tokenRepositoryMappings.load(				new FileInputStream("./tokenRepositoryMappings.properties"));			String fileName =				tokenRepositoryMappings.getProperty(publicIDInHex);			tokenDoc =				DocumentBuilderFactory					.newInstance()					.newDocumentBuilder()					.parse(					fileName);			initializeURNMappings();			initializeHeaderInfo();			currentCodepage = CODEPAGE_DEFAULT;		} catch (Exception exp) {			exp.printStackTrace();		}	}	private void initializeURNMappings() {		urnMappings = new Properties();		try {			urnMappings.load(				new FileInputStream("./urnCodepageMappings.properties"));		} catch (FileNotFoundException fnfExp) {			fnfExp.printStackTrace();		} catch (IOException ioExp) {			ioExp.printStackTrace();		}	}	private void initializeHeaderInfo() {		int total_codePages =			tokenDoc.getElementsByTagName("codepage").getLength();		codepages = new Hashtable[total_codePages][5];		for (int i = 0; i < codepages.length; i++) {			Element codepage = getCodepage(i);			initializeTags(codepage, i);			initializeAttributeNames(codepage, i);			initializeAttributeNameTokens(codepage, i);			initializeAttributeValues(codepage, i);		}		//		publicID = codePage.getAttribute("publicID");		//		String wbxmlEncodingStr = codePage.getAttribute("wbxmlVersion");		//		int dotPosition = wbxmlEncodingStr.indexOf('.');		//		byte majorVersion =		//			Byte.parseByte(wbxmlEncodingStr.substring(0, dotPosition));		//		majorVersion = (byte) (majorVersion - 1);		//		byte minorVersion =		//			Byte.parseByte(		//				wbxmlEncodingStr.substring(wbxmlEncodingStr.indexOf('.') + 1));		//		wbxmlEncoding = (byte) ((majorVersion << 4) + minorVersion);		//		String charEncodingStr = codePage.getAttribute("default_encoding");		//		charEncoding =		//			(byte) IANACharSet.getMIBEnum(charEncodingStr.toUpperCase());	}	private void initializeTags(Element codepage, int codePageNo) {		Hashtable tags = new Hashtable();		NodeList tagNodes = codepage.getElementsByTagName("tag");		Element aTag;		for (int i = 0; i < tagNodes.getLength(); i++) {			aTag = (Element) tagNodes.item(i);			tags.put(				aTag.getAttribute("name").toLowerCase(),				aTag.getAttribute("token-value"));		}		codepages[codePageNo][0] = tags;	}	private Element getCodepage(int codePageNo) {		NodeList allCodepages = tokenDoc.getElementsByTagName("codepage");		for (int i = 0; i < allCodepages.getLength(); i++) {			Element codepage = (Element) allCodepages.item(i);			if (Integer.parseInt(codepage.getAttribute("number").trim())				== codePageNo)				return codepage;		}		return null;	}	private void initializeAttributeNames(Element codepage, int codePageNo) {		Hashtable attributeNames = new Hashtable();		Hashtable attributePrefixes = new Hashtable();		NodeList attributeNameNodes =			codepage.getElementsByTagName("attribute-start");		Element anAttributeNameNode;		for (int i = 0; i < attributeNameNodes.getLength(); i++) {			anAttributeNameNode = (Element) attributeNameNodes.item(i);			String name = anAttributeNameNode.getAttribute("name");			String prefix = anAttributeNameNode.getAttribute("prefix");			String key = name + prefix;			attributeNames.put(				key.toLowerCase(),				anAttributeNameNode.getAttribute("token-value"));			if (attributePrefixes.containsKey(name))				 ((Vector) attributePrefixes.get(name)).addElement(prefix);			else {				Vector prefixes = new Vector();				prefixes.addElement(prefix);				attributePrefixes.put(name, prefixes);			}		}		codepages[codePageNo][1] = attributeNames;		codepages[codePageNo][2] = attributePrefixes;	}	private void initializeAttributeNameTokens(		Element codepage,		int codePageNo) {		Hashtable attributeNameTokens = new Hashtable();		NodeList attributeNameNodes =			tokenDoc.getElementsByTagName("attribute-start");		Element anAttributeNameNode;		for (int i = 0; i < attributeNameNodes.getLength(); i++) {			anAttributeNameNode = (Element) attributeNameNodes.item(i);			String token =				String.valueOf(					getByteValue(						anAttributeNameNode.getAttribute("token-value")));			String[] nameAndPrefixes = new String[2];			String name = anAttributeNameNode.getAttribute("name");			String prefix = anAttributeNameNode.getAttribute("prefix");			nameAndPrefixes[0] = name;			nameAndPrefixes[1] = prefix;			attributeNameTokens.put(token.toLowerCase(), nameAndPrefixes);		}		codepages[codePageNo][4] = attributeNameTokens;	}	private void initializeAttributeValues(Element codepage, int codePageNo) {		Hashtable attributeValues = new Hashtable();		NodeList attributeValueNodes =			codepage.getElementsByTagName("attribute-value");		Element anAttributeValueNode;		for (int i = 0; i < attributeValueNodes.getLength(); i++) {			anAttributeValueNode = (Element) attributeValueNodes.item(i);			attributeValues.put(				anAttributeValueNode.getAttribute("name").toLowerCase(),				anAttributeValueNode.getAttribute("token-value"));		}		codepages[codePageNo][3] = attributeValues;	}	public byte getTagToken(String tagName) {		Hashtable tags = codepages[currentCodepage][0];		return getByteValue(tags.get(tagName.toLowerCase()).toString());	}	private byte getByteValue(String value) {		try {			//byte tokenValue = Byte.parseByte(value, 16);			byte tokenValue = Integer.valueOf(value, 16).byteValue();			return tokenValue;		} catch (Exception exp) {			System.out.println("token not found!!!, returning literal");			return GlobalTokens.LITERAL;		}	}	public String getPublicIdentifier() {		Element codePage =			(Element) tokenDoc.getElementsByTagName("codepage").item(0);		return codePage.getAttribute("publicID");	}	public String getTagName(byte tokenValue) {		Hashtable tags = codepages[currentCodepage][0];		Iterator iterator = tags.entrySet().iterator();		return getKeyFromValue(iterator, tokenValue);	}	public String[] getAttributeNameAndPrefix(byte tokenValue) {		Hashtable attributeNameTokens = codepages[currentCodepage][4];		String token = String.valueOf(tokenValue);		return (String[]) attributeNameTokens.get(token);	}	public byte getAttributeNameToken(String attributeName, String prefix) {		Hashtable attributeNames = codepages[currentCodepage][1];		String token =			(String) attributeNames.get((attributeName + prefix).toLowerCase());		if (token == null)			return GlobalTokens.LITERAL;		return getByteValue(token);	}	public Vector getAttributePrefixes(String attributeName) {		Hashtable attributePrefixes = codepages[currentCodepage][2];		return (Vector) attributePrefixes.get(attributeName);	}	public String getAttributeValue(byte tokenValue) {		Hashtable attributeValues = codepages[currentCodepage][3];		Iterator iterator = attributeValues.entrySet().iterator();		return getKeyFromValue(iterator, tokenValue);	}	public byte getAttributeValueToken(String attributeValue) {		Hashtable attributeValues = codepages[currentCodepage][3];		String hexValue =			attributeValues.get(attributeValue.toLowerCase()).toString();		return getByteValue(hexValue);	}	private String getKeyFromValue(Iterator iterator, byte tokenValue) {		while (iterator.hasNext()) {			Map.Entry entry = (Map.Entry) iterator.next();			if (getByteValue(entry.getValue().toString()) == tokenValue)				return entry.getKey().toString();		}		return null;	}	/**	* Returns the attributeValues.	* @return Hashtable	*/	public Hashtable getAttributeValues() {		Hashtable attributeValues = codepages[currentCodepage][3];		return attributeValues;	}	public static void switchCodepage(String namespaceURN) {		if (namespaceURN == null)			currentCodepage = CODEPAGE_DEFAULT;		else {			byte codepage =				Integer					.valueOf(urnMappings.get(namespaceURN).toString())					.byteValue();			currentCodepage = codepage;		}	}	public static void setCurrentCodepage(byte codePageNo) {		currentCodepage = codePageNo;	}	public static byte getCurrentCodepage() {		return currentCodepage;	}	/**	 * @return String	 */	public String getCurrentNamespace() {		// TODO Auto-generated method stub		return null;	}}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品成人a区在线观看| 91视频免费播放| 久久综合久久综合久久综合| 99在线精品视频| 亚洲激情成人在线| 日韩精品一区二区三区在线播放| 国产毛片精品一区| 亚洲一区二区精品久久av| 欧美精品一区二区三区在线| 不卡影院免费观看| 国产原创一区二区| 亚洲国产成人va在线观看天堂| 精品入口麻豆88视频| 欧美日韩免费在线视频| 国产suv精品一区二区三区| 亚洲欧美电影院| 久久久不卡网国产精品一区| 欧美一区二区视频在线观看2022| www.日韩在线| 成人动漫av在线| 麻豆国产精品官网| 亚洲成人第一页| 亚洲欧美日韩国产成人精品影院| 久久中文娱乐网| 欧美一区二区三区在线看| 99久久99久久精品免费观看| 免费观看30秒视频久久| 亚洲欧美国产毛片在线| 国产日韩精品久久久| 日韩亚洲欧美一区| 欧美丰满嫩嫩电影| 色伊人久久综合中文字幕| 国产激情一区二区三区桃花岛亚洲| 亚洲午夜久久久久久久久电影网| 国产精品系列在线| 久久欧美中文字幕| 欧美一级淫片007| 欧美日韩五月天| 成人黄色777网| 国产高清在线精品| 韩国成人在线视频| 午夜精品123| 亚洲成人久久影院| 欧美国产成人精品| 国产精品毛片a∨一区二区三区| 26uuu亚洲综合色| 日韩久久精品一区| 欧美一二区视频| 色老汉一区二区三区| 99在线精品免费| jiyouzz国产精品久久| 国产精品一二三| 国产呦萝稀缺另类资源| 午夜精品久久久久久久| 亚洲高清免费一级二级三级| 亚洲一区二区三区四区在线| 18成人在线观看| 日韩理论片中文av| 综合久久一区二区三区| 亚洲免费观看高清| 亚洲综合色网站| 樱花草国产18久久久久| 一区二区三区中文免费| 亚洲综合无码一区二区| 亚洲一区二区三区四区五区中文| 亚洲成人动漫av| 青椒成人免费视频| 日韩在线观看一区二区| 麻豆一区二区三| 国内精品在线播放| av在线这里只有精品| 欧美色手机在线观看| 666欧美在线视频| 欧美mv日韩mv国产网站| 国产日韩精品视频一区| 日韩一区日韩二区| 亚洲综合另类小说| 天堂蜜桃一区二区三区| 日本在线观看不卡视频| 欧美一区二区三区小说| 国产99精品国产| 色香蕉成人二区免费| 欧美美女直播网站| 2020日本不卡一区二区视频| 国产精品区一区二区三区| 亚洲成人av电影在线| 久久se精品一区精品二区| 国产福利精品一区| 在线日韩一区二区| 日韩免费性生活视频播放| 国产精品无圣光一区二区| 亚洲制服丝袜一区| 热久久国产精品| kk眼镜猥琐国模调教系列一区二区 | 夜夜嗨av一区二区三区四季av| 日韩成人免费电影| 高清国产一区二区| 99久久99久久精品免费看蜜桃 | 国产精品国产三级国产专播品爱网| 久久精品亚洲乱码伦伦中文| 欧美激情综合五月色丁香| 亚洲图片一区二区| 久久爱www久久做| 91丨porny丨户外露出| 日韩欧美www| 亚洲黄色小说网站| 国产精品一色哟哟哟| 在线视频你懂得一区| 久久久久国色av免费看影院| 一区二区三区在线影院| 国产精品1区2区| 欧美精品xxxxbbbb| 国产精品二区一区二区aⅴ污介绍| 日本系列欧美系列| 色婷婷国产精品| 久久美女艺术照精彩视频福利播放| 亚洲男同1069视频| 国产精品一区二区视频| 欧美久久久久久蜜桃| 亚洲人成电影网站色mp4| 成人午夜碰碰视频| 精品乱码亚洲一区二区不卡| 亚洲成人精品一区| 成人高清免费观看| 精品捆绑美女sm三区| 日韩综合一区二区| 日本韩国精品一区二区在线观看| 久久久久久久久久久久久夜| 日韩av在线免费观看不卡| 色老综合老女人久久久| 中文字幕在线观看一区| 国产麻豆精品在线| 日韩精品一区二区三区swag| 午夜精品福利久久久| 色菇凉天天综合网| 中文字幕一区二区三区乱码在线| 九九国产精品视频| 日韩精品一区二区三区四区| 日韩精品色哟哟| 欧美电影在线免费观看| 亚洲国产一二三| 欧美在线色视频| 一区二区成人在线| 99久免费精品视频在线观看| 国产女同性恋一区二区| 国产精品一区二区久久不卡| 日韩美女视频一区二区在线观看| 五月天激情小说综合| 欧美男男青年gay1069videost| 亚洲国产人成综合网站| 欧美天堂一区二区三区| 日韩中文字幕麻豆| 欧美一卡在线观看| 精品在线视频一区| 精品成人免费观看| 国产一区二区三区久久久 | 亚洲午夜在线视频| 色女孩综合影院| 亚洲综合激情另类小说区| av电影天堂一区二区在线 | 日韩欧美高清在线| 精品一区二区影视| 久久久蜜桃精品| 国产成人av一区二区三区在线| 久久看人人爽人人| 丁香啪啪综合成人亚洲小说| 国产精品成人免费精品自在线观看| 99精品黄色片免费大全| 一区二区在线观看免费 | 国产一区二区三区蝌蚪| 国产日韩精品久久久| 91在线一区二区三区| 亚洲小说欧美激情另类| 91精品在线免费| 久久99国产精品成人| 久久午夜电影网| 成人a免费在线看| 亚洲成人黄色小说| 久久久综合激的五月天| 色婷婷狠狠综合| 国产在线精品一区二区夜色| 国产精品久久久久久久久久免费看| 高清成人在线观看| 国产日韩视频一区二区三区| 成人av网站大全| 亚洲免费在线视频| 欧美日韩电影在线播放| 久久av资源网| 国产精品福利一区二区三区| 在线国产亚洲欧美| 久久99久久精品欧美| 国产无遮挡一区二区三区毛片日本| 国产亚洲人成网站| 久久成人免费日本黄色| 欧美国产日韩在线观看| 日韩视频一区在线观看| 91香蕉视频污| 国产福利91精品一区二区三区| 丝瓜av网站精品一区二区| 亚洲欧洲国产日韩|