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

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

?? tokenrepository.java~7~

?? jwap 協議 udp 可以用于手機通訊
?? JAVA~7~
字號:
/** * 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(                                  TokenRepository.class.getResourceAsStream("/net/sourceforge/jwap/resources/wbxml/tokenRepositoryMappings.properties"));				//new FileInputStream("./tokenRepositoryMappings.properties"));                                //new FileInputStream("./net/sourceforge/jwap/resources/wbxml/tokenRepositoryMappings.properties"));			String fileName =				tokenRepositoryMappings.getProperty(publicIDInHex);                        String tempstr="";                        if(fileName.equals(""))                        {                           return;                        }                        else                        {                        }			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(                        TokenRepository.class.getResourceAsStream("/net/sourceforge/jwap/resources/wbxml/urnCodepageMappings.properties"));				//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一区二区三区免费野_久草精品视频
亚洲日本丝袜连裤袜办公室| 欧美精品少妇一区二区三区| 7777精品伊人久久久大香线蕉的 | 中文字幕一区二区在线观看| 欧美人与禽zozo性伦| 欧美一级在线观看| 狠狠色丁香久久婷婷综合_中| 精品国产不卡一区二区三区| av电影天堂一区二区在线 | 成+人+亚洲+综合天堂| 一区二区三区免费看视频| 日韩一区二区三区电影| av在线这里只有精品| 看国产成人h片视频| 亚洲成人精品一区| 欧美韩日一区二区三区四区| 欧美在线一二三四区| 成人美女在线视频| 久久精品国产久精国产| 亚洲一区二区视频| 精品国产一区二区三区四区四| 日本福利一区二区| 一本一道波多野结衣一区二区| 国产美女精品在线| 国产亚洲一本大道中文在线| 成人免费视频播放| 国产伦精品一区二区三区在线观看| 图片区小说区区亚洲影院| 亚洲一区二区在线免费观看视频 | 国产日韩成人精品| 精品欧美乱码久久久久久 | 国产精品超碰97尤物18| 久久人人爽人人爽| 精品成a人在线观看| 精品国产一区二区精华| 精品va天堂亚洲国产| 国产三级精品视频| 亚洲老妇xxxxxx| 午夜视频一区二区| 美女视频黄久久| 成人免费看片app下载| 欧美私人免费视频| 国产欧美精品区一区二区三区| 欧美国产乱子伦| 亚洲国产你懂的| 国产99精品国产| 欧美在线看片a免费观看| 日韩视频一区在线观看| 国产精品麻豆久久久| 亚洲自拍偷拍网站| 国产综合色精品一区二区三区| 粉嫩嫩av羞羞动漫久久久| 在线一区二区三区四区五区 | 久久无码av三级| 一区二区三区成人| 成人网在线播放| 日韩女优电影在线观看| 亚洲视频中文字幕| 国产剧情一区在线| 日韩三级视频在线看| 亚洲第一久久影院| 欧洲精品一区二区| 中文字幕制服丝袜一区二区三区| 青青草97国产精品免费观看| 丁香婷婷综合网| 777亚洲妇女| 亚洲黄色小视频| 国产精品一区2区| 欧美一区二区视频在线观看| 亚洲欧美综合色| 久久精品国产999大香线蕉| 成人av影视在线观看| 久久精品夜色噜噜亚洲a∨| 亚洲高清视频在线| 91麻豆国产精品久久| 国产亚洲午夜高清国产拍精品| 亚洲国产成人av好男人在线观看| 99国产精品一区| 亚洲国产精品v| 国产成人综合在线播放| 精品免费一区二区三区| 国产一区二区女| 亚洲精品伦理在线| 成人欧美一区二区三区视频网页| 国产mv日韩mv欧美| 国产日韩精品一区二区三区在线| 精品一区二区免费视频| 欧美成人官网二区| 国产剧情一区二区| 国产精品欧美一区二区三区| 国产一区二区不卡| 亚洲国产高清在线| 97久久超碰国产精品| 亚洲宅男天堂在线观看无病毒| 色婷婷综合久久久中文一区二区| 亚洲综合一区在线| 日韩欧美卡一卡二| av在线不卡免费看| 热久久国产精品| 狠狠色狠狠色合久久伊人| 日本午夜精品视频在线观看| 日韩午夜精品视频| 成人网男人的天堂| 午夜成人在线视频| 国产精品欧美一级免费| 欧美美女视频在线观看| 国产传媒久久文化传媒| 美洲天堂一区二卡三卡四卡视频| 日韩三级视频中文字幕| 在线一区二区三区做爰视频网站| 国产一区二区在线免费观看| 亚洲一二三区不卡| 一区二区不卡在线视频 午夜欧美不卡在| 高清不卡一二三区| 91小视频免费看| 国产成人一区二区精品非洲| 美女在线观看视频一区二区| 亚洲午夜久久久久| 一区二区三区日本| 亚洲一区二区三区四区在线| 国产精品无人区| 中文字幕在线观看不卡视频| 国产人成一区二区三区影院| 欧美成人女星排行榜| 一本高清dvd不卡在线观看| 不卡一区中文字幕| 欧美日韩精品一区视频| 久久奇米777| 亚洲一区二区四区蜜桃| 99久久综合99久久综合网站| 91丝袜国产在线播放| 在线看日本不卡| 欧美tk丨vk视频| 国产精品色哟哟| 亚洲成在人线免费| 久久99精品一区二区三区| 国产盗摄视频一区二区三区| 色噜噜狠狠色综合欧洲selulu| 欧美日韩国产大片| 亚洲婷婷国产精品电影人久久| 日韩av一区二区三区| av亚洲产国偷v产偷v自拍| 欧美一级精品在线| 亚洲免费资源在线播放| 亚洲激情五月婷婷| 久久色中文字幕| 一个色妞综合视频在线观看| 国精产品一区一区三区mba桃花| 91极品视觉盛宴| 国产精品国产精品国产专区不蜜 | 亚洲一级不卡视频| 99精品热视频| 亚洲欧美日韩中文字幕一区二区三区| 经典三级视频一区| 日韩女优av电影在线观看| 国产美女精品人人做人人爽| 亚洲欧洲综合另类| 国产伦精品一区二区三区在线观看| 欧美日高清视频| 午夜伦欧美伦电影理论片| 欧美天堂亚洲电影院在线播放| 夜夜夜精品看看| 欧美精品乱码久久久久久按摩| 亚洲观看高清完整版在线观看| 欧美亚洲图片小说| 欧美aaaaaa午夜精品| 久久综合资源网| 成人97人人超碰人人99| 伊人婷婷欧美激情| 欧美一卡2卡三卡4卡5免费| 国产一区二区h| 亚洲欧美日韩中文播放| 日韩一区二区免费在线观看| 国产精品一区在线观看你懂的| 欧美一区二区免费| 国产成人精品免费一区二区| 国产精品久久久久久久久免费樱桃| zzijzzij亚洲日本少妇熟睡| 亚洲图片一区二区| 国产亚洲一区二区在线观看| 欧美综合一区二区三区| 国产老肥熟一区二区三区| 午夜婷婷国产麻豆精品| 国产精品人人做人人爽人人添| 日韩一卡二卡三卡| 欧美在线观看一区二区| a在线欧美一区| 国产成人av在线影院| 国产呦萝稀缺另类资源| 看电视剧不卡顿的网站| 偷偷要91色婷婷| 亚洲夂夂婷婷色拍ww47| 亚洲激情综合网| 中文字幕中文字幕在线一区| 久久久久久久久久久99999| 日韩欧美国产小视频| 日韩一区二区在线观看| 欧美一级片在线| 精品国产青草久久久久福利| 日韩欧美中文字幕精品|