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

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

?? tokenrepository.java

?? jwap 協(xié)議 udp 可以用于手機通訊
?? JAVA
字號:
/** * 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;import java.io.InputStream;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);                      InputStream in=null;                        if(fileName.equals(""))                        {                           return;                        }                        else                        {                         String tempstr="";                         tempstr=fileName.substring(1);                         fileName="/net/sourceforge/jwap/resources/wbxml"+tempstr;                         in= TokenRepository.class.getResourceAsStream(fileName);                        }			tokenDoc =				DocumentBuilderFactory					.newInstance()					.newDocumentBuilder()					.parse(					in);			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一区二区三区免费野_久草精品视频
免费日本视频一区| 国产精品一二一区| 欧美日韩中文另类| 欧美私人免费视频| 亚洲午夜在线视频| 精品视频全国免费看| 午夜精品影院在线观看| 精品一区二区久久久| 国产日韩亚洲欧美综合| 成人午夜免费视频| 自拍偷在线精品自拍偷无码专区 | 日韩综合小视频| 欧美丰满少妇xxxxx高潮对白| 男女激情视频一区| 国产亚洲美州欧州综合国| 国产成人免费av在线| 亚洲同性gay激情无套| 久久欧美一区二区| 麻豆精品视频在线| 日本一区二区久久| 天天免费综合色| 国产无一区二区| 一本大道久久a久久精品综合| 手机精品视频在线观看| 国产亚洲美州欧州综合国| 色94色欧美sute亚洲线路二| 免费在线看一区| 中文字幕视频一区| 欧美精品v国产精品v日韩精品| 亚洲国产高清在线观看视频| 91国产成人在线| 精品夜夜嗨av一区二区三区| 亚洲激情图片小说视频| 国产激情精品久久久第一区二区| 欧美性感一区二区三区| 国产伦精品一区二区三区视频青涩 | 久久久久久久久岛国免费| 99这里只有久久精品视频| 欧美日韩中字一区| 最近中文字幕一区二区三区| 日韩欧美一区二区不卡| www.在线欧美| 久久激情综合网| 亚洲一区二区精品久久av| 国产欧美精品国产国产专区 | 欧美午夜精品免费| 国产成人久久精品77777最新版本 国产成人鲁色资源国产91色综 | 成人激情开心网| 久久精品国产一区二区三| 亚洲激情网站免费观看| 91香蕉视频黄| 国产成人av影院| 国产午夜精品一区二区| 91精品婷婷国产综合久久性色 | 美腿丝袜亚洲一区| 一区二区三区日韩在线观看| 久久精品99国产精品日本| 日韩欧美在线综合网| 久久91精品久久久久久秒播| 亚洲国产毛片aaaaa无费看 | 欧美国产精品v| 日韩欧美电影一区| 欧美日韩亚洲综合一区| 97久久超碰国产精品电影| 国模大尺度一区二区三区| 午夜激情综合网| 亚洲伊人色欲综合网| 亚洲免费观看在线观看| 91久久一区二区| 99久久久免费精品国产一区二区| 国产精品人成在线观看免费| 精品国产a毛片| 日韩欧美一卡二卡| 日韩欧美成人午夜| 欧美一卡二卡三卡| 日韩三级在线观看| 日韩欧美色电影| 日韩欧美在线1卡| 日韩毛片视频在线看| 欧美一区二区日韩| 91精品国产91久久久久久一区二区| 欧美色图天堂网| 欧美日韩成人综合天天影院| 欧美精品少妇一区二区三区| 欧美精品一级二级三级| 欧美一区二区在线观看| 欧美一区二区三区精品| 精品美女在线播放| 久久精品日产第一区二区三区高清版 | 亚洲福利一区二区三区| 欧美午夜精品理论片a级按摩| 欧美三级电影一区| 欧美挠脚心视频网站| 欧美一区在线视频| 国产成人超碰人人澡人人澡| 国产一区二区三区av电影| 国产99一区视频免费| 不卡一卡二卡三乱码免费网站| 99视频热这里只有精品免费| 色综合久久66| 91精品久久久久久蜜臀| 欧美成人激情免费网| 首页欧美精品中文字幕| 亚洲黄色av一区| 青青草国产成人av片免费| 国产一区二区美女| 99久久久久久| 欧美日韩三级一区二区| 亚洲精品在线免费观看视频| 国产精品国产三级国产有无不卡| 亚洲人成电影网站色mp4| 天堂一区二区在线免费观看| 狠狠色狠狠色综合日日91app| 一区二区成人在线视频| 麻豆久久久久久久| aaa国产一区| 欧美一区二区三区在线| 中文字幕乱码亚洲精品一区| 一级中文字幕一区二区| 久久91精品国产91久久小草| 色婷婷亚洲综合| 国产在线精品免费| 欧美丝袜丝交足nylons图片| 国产成人免费在线观看不卡| 色综合色综合色综合色综合色综合 | 看电影不卡的网站| 99久久久免费精品国产一区二区| 日韩欧美一区中文| 亚洲男人的天堂av| 精品一区二区三区久久久| 91片黄在线观看| 精品1区2区在线观看| 亚洲第一会所有码转帖| 国产xxx精品视频大全| 欧美日韩日本视频| 国产精品成人免费在线| 狠狠狠色丁香婷婷综合激情| 欧美性一区二区| 亚洲欧洲日韩一区二区三区| 久久精品国产精品亚洲红杏| 日本高清无吗v一区| 亚洲国产成人一区二区三区| 捆绑调教美女网站视频一区| 日本久久一区二区| 91美女视频网站| 欧美激情在线观看视频免费| 青青草精品视频| 欧美日韩精品福利| 亚洲精品中文字幕在线观看| 国产白丝精品91爽爽久久| 精品国产凹凸成av人网站| 奇米888四色在线精品| 欧美视频三区在线播放| 国产精品美女久久久久久久网站| 国产福利91精品一区| 精品日产卡一卡二卡麻豆| 午夜精品福利久久久| 欧美日韩在线免费视频| 亚洲自拍偷拍九九九| 91免费观看视频| 亚洲欧美另类综合偷拍| a亚洲天堂av| 91精品欧美综合在线观看最新| 亚洲狠狠爱一区二区三区| 日本精品一区二区三区高清 | hitomi一区二区三区精品| 国产片一区二区| 国产激情91久久精品导航| 久久久久国产精品人| 韩国一区二区三区| 不卡一区二区中文字幕| 综合电影一区二区三区| 色婷婷国产精品| 亚洲国产另类av| 欧美日韩大陆一区二区| 日本特黄久久久高潮| 日韩午夜三级在线| 精品中文字幕一区二区| 久久久精品人体av艺术| 成人网男人的天堂| 日韩在线观看一区二区| 欧美视频在线播放| 日韩电影在线免费看| 精品美女一区二区| 国产99久久久精品| 7777精品伊人久久久大香线蕉的 | 国产资源精品在线观看| 久久久不卡影院| 播五月开心婷婷综合| 亚洲免费观看高清完整版在线| 在线视频观看一区| 日韩精品免费专区| 久久人人爽爽爽人久久久| 成人午夜av影视| 亚洲成人激情av| 2021中文字幕一区亚洲| 欧美美女一区二区| 91免费观看在线| 玖玖九九国产精品| 国产午夜精品一区二区|