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

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

?? tokenrepository.java~5~

?? jwap 協議 udp 可以用于手機通訊
?? JAVA~5~
字號:
/** * 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(                        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一区二区三区免费野_久草精品视频
亚洲视频每日更新| 欧美精品久久99| 色一情一乱一乱一91av| 欧美电影精品一区二区 | 国内一区二区视频| 色婷婷狠狠综合| 精品久久久久香蕉网| 久久精品视频免费| 日本精品视频一区二区| ...av二区三区久久精品| 国内精品伊人久久久久av一坑| 欧美不卡在线视频| 九九精品一区二区| 国产午夜精品久久久久久免费视| 国产69精品久久久久毛片| 中文乱码免费一区二区| 91国产福利在线| 日韩福利电影在线观看| 视频一区国产视频| 日本韩国一区二区三区视频| 国产视频一区在线播放| 秋霞午夜av一区二区三区| 91日韩在线专区| 2014亚洲片线观看视频免费| 国产欧美日韩综合| 狠狠色狠狠色合久久伊人| 欧美日韩国产一级| 亚洲一区二区三区爽爽爽爽爽| 国产成a人亚洲| 久久免费看少妇高潮| 男女男精品视频| 欧美在线观看一区二区| 亚洲欧美一区二区三区孕妇| 不卡一区二区三区四区| 日本一区二区三级电影在线观看 | 精品在线观看免费| 欧美裸体bbwbbwbbw| 婷婷一区二区三区| 欧美猛男gaygay网站| 亚洲午夜一区二区三区| 欧美浪妇xxxx高跟鞋交| 亚洲成人综合网站| 欧美日韩国产一区| 亚洲午夜电影网| 777亚洲妇女| 亚洲成av人片| 日韩美女视频一区| 国产精品久久福利| 中文字幕在线播放不卡一区| 亚洲少妇最新在线视频| 亚洲黄色免费电影| 国产乱对白刺激视频不卡| 亚洲女性喷水在线观看一区| 欧美日韩国产综合视频在线观看| 日韩三级高清在线| 亚洲婷婷国产精品电影人久久| 国产视频一区在线播放| 亚洲欧美日韩久久| 91精品国产福利在线观看| 免费观看成人鲁鲁鲁鲁鲁视频| 日韩av一区二区三区| 午夜精品免费在线| 成人av中文字幕| 欧美一区二区三区视频免费 | 一区二区久久久久| 中文字幕一区免费在线观看| 午夜免费欧美电影| 国产成人在线视频网站| 欧美日韩成人一区二区| 国产女人18水真多18精品一级做 | 在线免费观看日韩欧美| 国产一区二三区| 色诱视频网站一区| 欧美日本不卡视频| 精品久久久三级丝袜| 亚洲一区二区三区四区中文字幕| 青青草国产成人av片免费| 一区二区三区在线视频免费| 亚洲第一激情av| 国产剧情在线观看一区二区| 在线看国产日韩| 中文字幕av一区二区三区| 亚洲综合免费观看高清完整版在线| 亚洲一区二区三区四区的| www.99精品| 国产亚洲午夜高清国产拍精品| 国产suv精品一区二区6| 久久亚洲精华国产精华液| 一区二区三区视频在线看| 国产精品羞羞答答xxdd| 色婷婷狠狠综合| 国产美女在线精品| 一区精品在线播放| 不卡视频在线观看| 中文字幕一区二区视频| 国产一区二区三区最好精华液| 激情五月婷婷综合网| 久久蜜桃香蕉精品一区二区三区| 色婷婷久久久综合中文字幕| 日本欧美韩国一区三区| 日韩电影免费一区| 色欲综合视频天天天| 精品无人码麻豆乱码1区2区 | 日韩欧美一级精品久久| 色婷婷综合在线| 国产精品一区不卡| 蜜臀av一级做a爰片久久| 亚洲一级二级在线| 亚洲人123区| 国产精品美女久久久久av爽李琼| 日韩精品一区二区三区四区| 在线播放91灌醉迷j高跟美女 | 久久日韩精品一区二区五区| 喷水一区二区三区| 精品免费99久久| 91老师国产黑色丝袜在线| 蜜桃av一区二区| 亚洲精品一二三区| 538在线一区二区精品国产| 国产精品一区二区免费不卡| 欧美另类久久久品| 色欧美乱欧美15图片| 91蜜桃在线观看| 91丝袜美女网| 91年精品国产| 一本一道久久a久久精品综合蜜臀| 国产成人精品亚洲777人妖| 精品一区二区三区在线播放视频| 日本不卡一区二区三区| 久草这里只有精品视频| 国产精品资源在线| 丁香五精品蜜臀久久久久99网站| 国产美女一区二区| 日韩电影一区二区三区四区| 久久精品国产亚洲aⅴ| www.成人在线| 日韩欧美一二三区| 91精品国产综合久久久久久漫画| 欧美精品在线视频| 91蜜桃婷婷狠狠久久综合9色| 成人性生交大片免费看视频在线 | 久久精品国产99| 欧美日韩一区精品| 欧美日韩在线播放一区| 欧美午夜精品电影| 欧美一级夜夜爽| 亚洲精品一区二区精华| 日本一二三四高清不卡| 中文字幕一区二区5566日韩| 亚洲精品欧美激情| 免费观看在线综合| 国产不卡视频一区二区三区| 91社区在线播放| 欧美日韩国产bt| 日韩精品乱码免费| 北条麻妃一区二区三区| 欧美va亚洲va| 亚洲精品国产一区二区精华液| 亚洲免费成人av| 日韩高清欧美激情| 国产麻豆精品视频| 在线观看日韩国产| 国产欧美综合在线观看第十页| 一区二区视频免费在线观看| 午夜精品福利一区二区三区蜜桃| 午夜久久电影网| 成人性生交大片免费看视频在线| 亚洲女性喷水在线观看一区| 亚洲第一成年网| 国产大片一区二区| 欧美视频在线观看一区二区| wwwwxxxxx欧美| 亚洲一区在线观看免费观看电影高清 | 精品免费日韩av| 亚洲一二三四区不卡| 春色校园综合激情亚洲| 欧美精品日日鲁夜夜添| 亚洲三级在线播放| 国产综合久久久久影院| 欧美吻胸吃奶大尺度电影| 欧美激情一区三区| 狠狠v欧美v日韩v亚洲ⅴ| 欧美视频精品在线观看| 亚洲视频在线观看三级| 成人福利视频网站| 久久久www免费人成精品| 美女久久久精品| 欧美男女性生活在线直播观看| 亚洲欧美一区二区三区孕妇| 岛国av在线一区| 国产性天天综合网| 免费在线观看日韩欧美| 欧美性欧美巨大黑白大战| 亚洲视频1区2区| 色综合网色综合| 亚洲视频小说图片| 国产成人精品一区二| 国产夜色精品一区二区av| 久久精品99久久久| 日韩欧美一区二区免费|