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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? tokenrepository.java~6~

?? jwap 協(xié)議 udp 可以用于手機(jī)通訊
?? JAVA~6~
字號(hào):
/** * 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="";			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;	}}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品国产乱码久久久久久牛牛 | 国产美女视频91| 一区二区三区国产| 国产午夜精品美女毛片视频| 日韩三级在线免费观看| 欧美人妇做爰xxxⅹ性高电影| 91色在线porny| 色婷婷一区二区| 在线一区二区观看| 欧美最新大片在线看| 欧美在线观看视频在线| 欧美少妇一区二区| 欧美疯狂做受xxxx富婆| 91精品免费观看| 欧美一区二区成人6969| 精品美女一区二区| 国产精品无码永久免费888| 亚洲国产精品成人综合| 日韩理论片中文av| 视频一区欧美精品| 激情小说亚洲一区| 9人人澡人人爽人人精品| 色88888久久久久久影院按摩 | 国产成人免费网站| 91在线看国产| 91精品啪在线观看国产60岁| 久久久久九九视频| 亚洲另类在线视频| 蜜臀久久久久久久| 韩国精品在线观看| 不卡一区中文字幕| 欧美精品在线一区二区| 日韩精品最新网址| 欧美激情一区二区三区不卡| 一区二区三区四区不卡视频| 亚洲欧洲三级电影| 婷婷久久综合九色综合伊人色| 亚洲成a人片综合在线| 国产乱子伦一区二区三区国色天香| 国产激情精品久久久第一区二区 | 国产美女一区二区| 欧美色视频在线| 国产欧美精品日韩区二区麻豆天美| 国产欧美精品区一区二区三区 | 中文字幕一区三区| 国产精品免费aⅴ片在线观看| 亚洲精品老司机| 亚洲国产成人高清精品| 国产成人av一区二区| 在线观看网站黄不卡| 欧美国产成人精品| 亚洲大片在线观看| 99这里只有精品| 8x福利精品第一导航| 亚洲天堂久久久久久久| 秋霞影院一区二区| 在线视频综合导航| 久久精品亚洲国产奇米99| 午夜欧美视频在线观看| 国产激情一区二区三区四区| av电影在线观看完整版一区二区| 欧洲一区二区av| 日韩精品一区二区三区视频播放 | 亚洲国产你懂的| 黄色成人免费在线| 欧美老人xxxx18| 国产精品女人毛片| 丰满岳乱妇一区二区三区| 欧美手机在线视频| 亚洲综合色区另类av| 国产成人激情av| 欧美电影影音先锋| 亚洲精品乱码久久久久久日本蜜臀| 国产99精品视频| 欧美成人aa大片| 日韩电影在线看| 91国产成人在线| 亚洲男同性视频| 成人丝袜高跟foot| 国产精品乱码一区二三区小蝌蚪| 久久国内精品自在自线400部| 337p亚洲精品色噜噜噜| 亚洲国产精品一区二区久久| 9i看片成人免费高清| 欧美极品美女视频| 九九精品视频在线看| 制服丝袜日韩国产| 亚洲大片一区二区三区| 日本久久电影网| 香蕉加勒比综合久久| 欧美巨大另类极品videosbest | 婷婷综合久久一区二区三区| 大胆亚洲人体视频| 综合色中文字幕| 久久99精品久久久久| 91麻豆精品国产自产在线| 亚洲成人av一区二区三区| 色一区在线观看| 亚洲一二三四区| a级精品国产片在线观看| 亚洲国产成人一区二区三区| 色婷婷精品大在线视频 | jlzzjlzz欧美大全| 国产精品日产欧美久久久久| 欧美伊人久久久久久午夜久久久久| 国产精品国产三级国产aⅴ入口| 99久久国产综合色|国产精品| 日韩一区在线看| 91.com视频| 国产综合久久久久久久久久久久| 国产精品女同互慰在线看 | 午夜精品一区二区三区免费视频| 在线亚洲一区二区| 毛片av中文字幕一区二区| 精品国产在天天线2019| 国产原创一区二区| 国产精品福利一区二区三区| 欧美性生活大片视频| 久久精品久久99精品久久| 久久久久一区二区三区四区| 成人av在线网站| 久久不见久久见中文字幕免费| 久久精品欧美一区二区三区不卡| 色综合一个色综合| 视频一区二区三区中文字幕| 国产精品国产三级国产| 欧美日韩不卡一区| 国产酒店精品激情| 一区二区三区蜜桃网| 日韩三级高清在线| 高清国产一区二区三区| 日韩成人一级大片| 26uuu久久综合| 91精品福利在线一区二区三区 | 久久久精品国产免费观看同学| 欧美三片在线视频观看| 毛片一区二区三区| 日韩av电影一区| 国产精品电影一区二区| 欧美大片在线观看一区| 色爱区综合激月婷婷| 精一区二区三区| 亚洲精品中文在线影院| 久久精品在这里| 日韩视频国产视频| 91亚洲男人天堂| 国产美女娇喘av呻吟久久| 亚洲激情第一区| 国产亚洲综合色| 欧美一区二区视频网站| 色综合激情五月| 成人99免费视频| 国产在线国偷精品产拍免费yy| 午夜影院在线观看欧美| 亚洲国产精华液网站w| 精品免费一区二区三区| 7777精品伊人久久久大香线蕉 | 国产欧美综合在线观看第十页| 欧美日韩免费一区二区三区视频| 成人一区二区三区视频在线观看| 日韩av成人高清| 国产精品久久久一本精品| 国产三级欧美三级| 中文字幕巨乱亚洲| 欧美激情一区二区三区在线| 日本一区二区三区四区在线视频| 欧美日韩精品专区| 日韩精品资源二区在线| 91一区二区三区在线播放| 91免费国产在线| av在线不卡免费看| www.99精品| 国产一区二区三区| 亚洲国产精品天堂| 天天色天天爱天天射综合| 亚洲影院在线观看| 亚洲午夜久久久久中文字幕久| 亚洲乱码国产乱码精品精98午夜 | 中文字幕免费不卡| 国产女主播一区| 亚洲一二三级电影| 亚洲一区二区三区不卡国产欧美| 一区二区三区视频在线观看| 亚洲欧洲av在线| 亚洲综合男人的天堂| 亚洲成人免费在线| 久久精品国产999大香线蕉| 丝袜美腿亚洲色图| 理论片日本一区| 久草中文综合在线| 国产成人福利片| 丁香另类激情小说| 9i在线看片成人免费| 91丨porny丨蝌蚪视频| 在线观看免费成人| 亚洲精品在线三区| 日韩欧美的一区| 亚洲摸摸操操av| 亚洲精品在线观看网站| 亚洲乱码中文字幕综合|