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

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

?? tokenrepository.java~4~

?? jwap 協議 udp 可以用于手機通訊
?? JAVA~4~
字號:
/** * 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);			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一区二区三区免费野_久草精品视频
国产精品无遮挡| 亚洲一区二区四区蜜桃| 日韩精品一级中文字幕精品视频免费观看 | 国产精品久久久久久久久晋中| 日韩电影在线观看电影| av网站一区二区三区| 国产喷白浆一区二区三区| 久久精品国产在热久久| 91精品国产入口| 久久99国产精品免费| 日韩午夜三级在线| 免费在线观看精品| 久久久美女毛片| 国产成人精品免费一区二区| 国产精品久久久久影院亚瑟 | 欧美日韩国产综合一区二区三区| 日韩精品色哟哟| 日韩三级在线免费观看| 国产在线不卡一卡二卡三卡四卡| 久久久www免费人成精品| 99久久99久久精品免费观看| 亚洲国产成人高清精品| 欧美电影免费观看高清完整版在 | 成人精品国产免费网站| 亚洲欧美精品午睡沙发| 精品av久久707| 91免费看片在线观看| 蜜臀久久久久久久| 亚洲视频一区在线| 精品久久久久久最新网址| 91视频免费播放| 久久精品72免费观看| 夜夜嗨av一区二区三区中文字幕 | 亚洲日本在线视频观看| 欧美zozo另类异族| 欧美日韩精品欧美日韩精品| 国产成人精品亚洲日本在线桃色 | 91香蕉视频mp4| 国产一区二区三区在线观看免费视频 | 精品亚洲国内自在自线福利| 国产精品国模大尺度视频| 久久久久久亚洲综合| 91精品综合久久久久久| 欧美性色综合网| 色狠狠av一区二区三区| 波多野结衣中文一区| 美女久久久精品| 蜜桃一区二区三区在线| 舔着乳尖日韩一区| 天堂av在线一区| 亚洲成人av一区二区| 亚洲制服丝袜在线| 一区二区欧美视频| 一区二区三区精品| 亚洲成人综合网站| 亚洲国产视频在线| 丝袜诱惑亚洲看片| 麻豆精品久久精品色综合| 蜜臀va亚洲va欧美va天堂| 欧美aaa在线| 国产精品小仙女| 97久久超碰国产精品电影| 91老师片黄在线观看| 欧美美女直播网站| 欧美成人一区二区| 日本一区二区三区电影| 亚洲色图视频网| 日本午夜一区二区| 国产福利一区二区| 91成人国产精品| 日韩欧美国产麻豆| 国产精品视频你懂的| 亚洲成人av一区二区三区| 国产在线精品一区二区| 91污在线观看| 久久综合久久综合久久综合| 成人免费小视频| 韩国女主播一区| 在线这里只有精品| 欧美激情一二三区| 午夜精品久久久| 99视频有精品| 久久久久九九视频| 午夜久久久影院| 91小视频免费看| 久久久久国产精品免费免费搜索| 亚洲va天堂va国产va久| 成人高清视频在线| 国产清纯在线一区二区www| 日本成人超碰在线观看| 色哦色哦哦色天天综合| 国产精品青草久久| 国产乱码精品一区二区三区忘忧草| 欧美亚洲丝袜传媒另类| 国产精品黄色在线观看| 丁香婷婷深情五月亚洲| 精品国产乱码久久| 激情久久五月天| 欧美一区二区不卡视频| 日日夜夜精品视频天天综合网| 在线视频一区二区三| 亚洲乱码日产精品bd| 色诱视频网站一区| 亚洲三级电影网站| 91国偷自产一区二区开放时间| 亚洲裸体xxx| 色拍拍在线精品视频8848| 洋洋成人永久网站入口| 欧美日韩视频第一区| 午夜精品久久久久影视| 欧美成人精品1314www| 久久不见久久见免费视频1| 精品国精品自拍自在线| 成人激情文学综合网| 亚洲精品福利视频网站| 日韩欧美一区二区三区在线| 久久99国产精品免费网站| 中文字幕一区二区不卡| 欧美日韩综合色| 国产精品一线二线三线| 亚洲综合激情网| 欧美本精品男人aⅴ天堂| 91丨porny丨蝌蚪视频| 经典一区二区三区| 亚洲资源中文字幕| 国产日产亚洲精品系列| 色综合一个色综合| 国模娜娜一区二区三区| 一区二区三区资源| 久久久一区二区三区| 欧美蜜桃一区二区三区| 高清免费成人av| 日本色综合中文字幕| 亚洲国产成人av好男人在线观看| 久久久精品蜜桃| 日韩欧美一级片| 欧美日韩二区三区| 91视频国产观看| 97国产一区二区| 粉嫩绯色av一区二区在线观看| 男男视频亚洲欧美| 午夜精品久久久久久不卡8050| 国产精品全国免费观看高清| 久久久亚洲精品石原莉奈| 欧美美女网站色| 欧美一区二区三区免费视频| 欧美在线一二三| 欧美精品在线视频| 欧美区在线观看| 91精品免费观看| 日韩一级片网站| 欧美精品一区在线观看| 亚洲精品在线三区| 精品久久久久久久一区二区蜜臀| 日韩欧美高清一区| 久久综合狠狠综合久久综合88 | 丰满少妇久久久久久久| 国产成人午夜99999| 91污在线观看| 欧美丝袜丝交足nylons图片| 91精品国产综合久久久蜜臀图片| 色综合久久综合中文综合网| 欧美色图12p| 精品欧美久久久| 亚洲色图欧美激情| 日韩精品久久理论片| 国产精品18久久久| 色欲综合视频天天天| 日韩视频在线永久播放| 欧美国产日韩亚洲一区| 五月激情综合婷婷| 麻豆专区一区二区三区四区五区| 福利一区二区在线| 欧美视频三区在线播放| 日本一区二区不卡视频| 亚洲第一狼人社区| 成av人片一区二区| 欧美一级理论片| 亚洲色图欧美在线| 国内外成人在线| 91精品国产综合久久福利软件| 久久久久久久久久久黄色| 一区二区不卡在线视频 午夜欧美不卡在| 天天亚洲美女在线视频| 成人av综合一区| 精品88久久久久88久久久| 亚洲丶国产丶欧美一区二区三区| 成人性生交大片免费看在线播放| 8x福利精品第一导航| 亚洲色图欧美激情| 成+人+亚洲+综合天堂| 久久精品亚洲麻豆av一区二区| 日本sm残虐另类| 欧美日韩在线电影| 亚洲一区二区三区影院| 91久久奴性调教| 一区二区三区精品视频在线| 91美女在线看| 亚洲午夜电影在线| 色综合天天做天天爱|