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

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

?? tokenrepository.java~3~

?? jwap 協議 udp 可以用于手機通訊
?? JAVA~3~
字號:
/** * 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"));                                new FileInputStream("./net/sourceforge/jwap/resources/wbxml/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一区二区三区免费野_久草精品视频
亚洲一区二区欧美日韩 | 亚洲网友自拍偷拍| 不卡的电影网站| 亚洲乱码国产乱码精品精98午夜| 91亚洲男人天堂| 一级做a爱片久久| 欧美精品一卡二卡| 久久99久久99精品免视看婷婷 | 亚洲国产日韩av| 欧美美女直播网站| 精品伊人久久久久7777人| 国产午夜久久久久| 欧美中文字幕一二三区视频| 日韩中文字幕不卡| 久久精品一区四区| 欧美性生交片4| 国产在线精品一区二区夜色 | 国产精品女同一区二区三区| 大陆成人av片| 亚洲一二三四在线| 精品入口麻豆88视频| 成人黄色一级视频| 天堂一区二区在线免费观看| 久久毛片高清国产| 色综合天天做天天爱| 午夜久久久久久电影| 久久久精品国产99久久精品芒果 | 欧美日韩一区高清| 国产成人自拍网| 亚洲一区二区三区小说| 欧美精品一区二区高清在线观看| 91网上在线视频| 日韩不卡一二三区| 中文字幕在线不卡视频| 欧美日韩精品久久久| 亚洲一卡二卡三卡四卡五卡| 久久日韩精品一区二区五区| 91国在线观看| 国产jizzjizz一区二区| 日本亚洲最大的色成网站www| 国产精品久久久久桃色tv| 日韩一级大片在线观看| 在线视频国内自拍亚洲视频| 成人在线视频首页| 久久不见久久见中文字幕免费| 亚洲视频一区二区免费在线观看| 精品久久人人做人人爰| 欧美色区777第一页| 91在线观看下载| 国内成+人亚洲+欧美+综合在线| 亚洲国产综合人成综合网站| 亚洲欧洲韩国日本视频| 久久久国产精品午夜一区ai换脸| 欧美一级黄色录像| 欧美日韩免费一区二区三区视频 | 一本大道久久a久久精二百| 国产一区二三区| 日本午夜一区二区| 色婷婷综合在线| 国产精品99久久久久久似苏梦涵 | 亚洲一区二区在线免费观看视频| 久久久久国产精品人| 欧美成人乱码一区二区三区| 91麻豆精品国产91久久久更新时间 | 欧美群妇大交群中文字幕| 色综合天天综合网天天看片| 成人免费精品视频| 成人免费视频视频| 波多野结衣91| 99v久久综合狠狠综合久久| 成人污污视频在线观看| 高清beeg欧美| a亚洲天堂av| 91亚洲永久精品| 色综合网色综合| 欧美亚一区二区| 欧美日韩日日摸| 91精品啪在线观看国产60岁| 欧美激情在线一区二区| 久久久久国色av免费看影院| 久久久亚洲高清| 久久久久久久综合狠狠综合| 美女脱光内衣内裤视频久久影院| 老司机精品视频线观看86| 亚洲一区二区综合| 亚洲成av人**亚洲成av**| 同产精品九九九| 日韩成人一级片| 久久se精品一区精品二区| 黄色成人免费在线| 丁香天五香天堂综合| av网站免费线看精品| 一本色道a无线码一区v| 欧美吞精做爰啪啪高潮| 9191精品国产综合久久久久久| 欧美一区二区啪啪| 久久精品亚洲精品国产欧美| 欧美—级在线免费片| 亚洲精品v日韩精品| 一区二区日韩电影| 美腿丝袜亚洲三区| 国产精品1区2区| 91小视频在线免费看| 欧美电影影音先锋| 久久精品亚洲乱码伦伦中文 | 91性感美女视频| av中文字幕亚洲| 精品视频全国免费看| 日韩欧美卡一卡二| 中文字幕乱码久久午夜不卡| 樱桃视频在线观看一区| 日韩电影一区二区三区四区| 国产成人精品免费在线| 欧美三级电影网| 国产三级久久久| 亚洲精品成人在线| 激情丁香综合五月| 欧美主播一区二区三区美女| 欧美r级在线观看| 蜜臀a∨国产成人精品| 成人一区二区视频| 欧美日韩免费电影| 国产精品入口麻豆原神| 日韩国产在线观看一区| 91伊人久久大香线蕉| 精品国产一区久久| 亚洲一区二区三区视频在线播放| 国产一区不卡在线| 欧美日韩三级在线| 亚洲天堂av一区| 国产高清在线观看免费不卡| 7777精品伊人久久久大香线蕉完整版| 中文字幕不卡在线观看| 免费成人性网站| 欧美怡红院视频| 中文字幕亚洲视频| 国产成人高清视频| 精品盗摄一区二区三区| 婷婷一区二区三区| 在线精品亚洲一区二区不卡| 国产三级欧美三级日产三级99| 免费一级片91| 欧美视频日韩视频在线观看| 国产精品不卡一区| 福利91精品一区二区三区| 欧美mv日韩mv| 久久精品99国产精品| 欧美日韩一区 二区 三区 久久精品| 国产精品系列在线| 国产.欧美.日韩| 欧美激情一区二区三区在线| 另类小说综合欧美亚洲| 欧美二区三区的天堂| 午夜精品久久久久久久久| 欧美性做爰猛烈叫床潮| 一区二区三区**美女毛片| 色猫猫国产区一区二在线视频| 国产精品久久久久永久免费观看 | 亚洲欧美中日韩| 播五月开心婷婷综合| 中国色在线观看另类| 国产91精品入口| 国产精品欧美经典| 99精品国产热久久91蜜凸| 国产精品乱人伦| 成人avav影音| 一区二区中文字幕在线| 91亚洲精品久久久蜜桃网站| 亚洲美女屁股眼交| 在线免费观看视频一区| 亚洲成a人v欧美综合天堂| 欧美精选一区二区| 麻豆免费精品视频| 精品国产一区二区三区不卡| 国产一区二区美女诱惑| 中文字幕欧美日本乱码一线二线| av一区二区不卡| 亚洲一区二区视频| 欧美一区二区三区系列电影| 国内成人免费视频| 国产精品伦一区二区三级视频| 91女人视频在线观看| 男人的天堂久久精品| 日韩欧美不卡在线观看视频| 国产精品资源在线观看| 国产精品入口麻豆原神| 欧美主播一区二区三区美女| 免费观看久久久4p| 亚洲国产精品精华液ab| 91美女在线看| 免费看欧美女人艹b| 国产拍欧美日韩视频二区 | 欧美日韩日本视频| 精品一区二区三区影院在线午夜| 国产无遮挡一区二区三区毛片日本| 99re亚洲国产精品| 午夜视频一区在线观看| 久久综合久久综合九色| 91亚洲精品一区二区乱码| 日韩电影在线观看电影|