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

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

?? messagefactory.java

?? 關(guān)于 RFID 讀寫器的相關(guān)內(nèi)容
?? JAVA
字號(hào):
/*
 * Copyright (C) 2007 ETH Zurich
 *
 * This file is part of Fosstrak (www.fosstrak.org).
 *
 * Fosstrak is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License version 2.1, as published by the Free Software Foundation.
 *
 * Fosstrak 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 Fosstrak; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA  02110-1301  USA
 */

package org.fosstrak.reader.rprm.core.msg;

import java.util.HashMap;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;

/**
 * Singleton factory class which creates the concrete instances of a
 * <code>MessageParser</code> and a <code>MessageSerializer</code>. Because
 * the whole ReaderProtocol infrastructure can use the same parsers and the same
 * serializers we can use a singleton instance of the parser and serialiser.
 * Hence there is a singelton instance for each message binding.
 * 
 * @author Andreas F黵er, ETH Zurich Switzerland, Winter 2005/06
 */
public class MessageFactory {
	/** The singleton instance of the MessageFactory. */
	private static MessageFactory instance;

	/** The singleton instance of the XML parser. */
	private static HashMap xmlParsers = new HashMap(); //XmlMessageParser

	/** The singleton instance of the XML serializer. */
	private static HashMap xmlSerializers = new HashMap(); //XmlMessageSerializer

	/** The singleton instance of the TEXT parser. */
	private static HashMap textParsers = new HashMap(); //TextMessageParser

	/** The singleton instance of the TEXT serializer. */
	private static HashMap textSerializers = new HashMap(); //TextMessageSerializer

	/**
	 * Returns the singleton instance of a <code>MessageBindingFactory</code>.
	 * 
	 * @return The <code>MessageBindingFactory</code>.
	 */
	public static MessageFactory getInstance() {
		if (instance == null) {
			instance = new MessageFactory();
		}
		return instance;
	}

	/**
	 * Gets the singleton instance of a <code>XmlMessageParser</code>.
	 * 
	 * @return a parser
	 */
	public MessageParser getXmlMessageParser(JAXBContext jaxbContext) {
		XmlMessageParser xmlParser = (XmlMessageParser)xmlParsers.get(jaxbContext);
		if (xmlParser == null) {
			xmlParser = new XmlMessageParser(jaxbContext);
			xmlParsers.put(jaxbContext, xmlParser);
		}
		return xmlParser;
	}

	/**
	 * Gets the singleton instance of a <code>XmlMessageSerializer</code>.
	 * 
	 * @return a serializer
	 */
	public MessageSerializer getXmlMessageSerializer(JAXBContext jaxbContext) {
		XmlMessageSerializer xmlSerializer = (XmlMessageSerializer)xmlSerializers.get(jaxbContext);
		if (xmlSerializer == null) {
			xmlSerializer = new XmlMessageSerializer();
			xmlSerializers.put(jaxbContext, xmlSerializer);
		}
		return xmlSerializer;
	}

	/**
	 * Gets the singleton instance of a <code>TextMessageParser</code>.
	 * @param jaxbContext 
	 * 
	 * @return a parser
	 */
	public MessageParser getTextMessageParser(Context context) {
		TextMessageParser textParser = (TextMessageParser)textParsers.get(context);
		if (textParser == null) {
			textParser = new TextMessageParser(context);
			textParsers.put(context, textParser);
		}
		return textParser;
	}

	/**
	 * Gets the singleton instance of a <code>TextMessageSerializer</code>.
	 * 
	 * @return a serializer
	 */
	public MessageSerializer getTextMessageSerializer(Context context) {
		TextMessageSerializer textSerializer = (TextMessageSerializer)textSerializers.get(context);
		if (textSerializer == null) {
			textSerializer = new TextMessageSerializer();
			textSerializers.put(context, textSerializer);
		}
		return textSerializer;
	}

	/**
	 * Gets an instance of the parser for the corresponding message format.
	 * 
	 * @param msgFormat
	 *            the format of the message
	 * @param jaxbContext 
	 * @return the corresponding <code>MessageParser</code>
	 * @throws MessageParsingException
	 *             If the message format is unknown.
	 */
	public MessageParser createParser(final MessageFormat msgFormat, Context context)
			throws MessageParsingException {
		if (msgFormat == MessageFormat.XML) {
			try {
				JAXBContext jaxbContext = context.getJAXBContext();
				return getXmlMessageParser(jaxbContext);
			} catch(JAXBException e) {
				throw new MessageParsingException(MessagingConstants.ERROR_UNKNOWN,
						MessagingConstants.ERROR_UNKNOWN_STR,
						"Illegal message format.");
			}
		} else if (msgFormat == MessageFormat.TEXT) {
			return getTextMessageParser(context);
		} else {
			throw new MessageParsingException(MessagingConstants.ERROR_UNKNOWN,
					MessagingConstants.ERROR_UNKNOWN_STR,
					"Illegal message format.");
		}
	}

	/**
	 * Gets an instance of the serializer for the corresponding message format.
	 * 
	 * @param msgFormat
	 *            the format of the message
	 * @return the corresponding <code>MessageSerializer</code>
	 * @throws MessageSerializingException
	 *             If the message format is unknown.
	 */
	public MessageSerializer createSerializer(final MessageFormat msgFormat, Context context)
			throws MessageSerializingException {
		if (msgFormat == MessageFormat.XML) {
			try {
				return getXmlMessageSerializer(context.getJAXBContext());
			} catch (JAXBException e) {
				throw new MessageSerializingException("Illegal message format.");
			}
		} else if (msgFormat == MessageFormat.TEXT) {
			return getTextMessageSerializer(context);
		} else {
			throw new MessageSerializingException("Illegal message format.");
		}
	}

}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区三区四区不卡在线| 欧美日韩成人一区二区| 久久久久久9999| 国产精品中文字幕日韩精品 | 国产欧美日韩在线视频| 国精产品一区一区三区mba视频| 欧美精品一区二区在线观看| 久久国产精品色| 国产女同互慰高潮91漫画| 成人久久18免费网站麻豆 | 亚洲一二三四久久| 欧美色爱综合网| 人妖欧美一区二区| 国产欧美一区二区三区网站| 99re成人在线| 蜜桃视频在线一区| 国产精品女主播在线观看| av电影在线不卡| 亚洲午夜av在线| 欧美成人精品二区三区99精品| 极品少妇xxxx精品少妇| 综合欧美亚洲日本| 欧美日韩国产123区| 美女高潮久久久| 国产精品久久毛片| 欧美日韩视频第一区| 国产麻豆成人精品| 亚洲综合在线观看视频| 精品国产露脸精彩对白| 91福利在线观看| 国产精品羞羞答答xxdd| 亚洲精品菠萝久久久久久久| 欧美成人a在线| 日本高清免费不卡视频| 黑人巨大精品欧美一区| 亚洲女人小视频在线观看| 欧美一区二区视频在线观看2022 | 精品国产sm最大网站免费看| 99久久婷婷国产| 蜜臀av亚洲一区中文字幕| 日韩美女精品在线| 精品福利二区三区| 91福利视频久久久久| 国产激情一区二区三区桃花岛亚洲| 伊人开心综合网| 国产女人18水真多18精品一级做| 精品视频色一区| 成人aa视频在线观看| 捆绑紧缚一区二区三区视频 | 亚洲aaa精品| 《视频一区视频二区| 精品女同一区二区| 欧美日韩极品在线观看一区| 成人18视频在线播放| 激情综合网最新| 天天综合天天做天天综合| 中文字幕亚洲综合久久菠萝蜜| 精品国产制服丝袜高跟| 欧美日韩国产另类一区| 色综合天天天天做夜夜夜夜做| 国产精品自拍三区| 久久精品理论片| 免费看精品久久片| 亚洲bt欧美bt精品777| 亚洲免费av观看| 亚洲欧美日韩电影| 成人免费视频在线观看| 欧美激情一区二区三区蜜桃视频| 日韩亚洲欧美一区| 在线不卡免费欧美| 在线成人av网站| 欧美高清精品3d| 欧美日本一道本在线视频| 色婷婷久久久亚洲一区二区三区| 成av人片一区二区| 99麻豆久久久国产精品免费优播| 国产99久久久国产精品潘金网站| 国产精品香蕉一区二区三区| 国产酒店精品激情| 国产成人午夜高潮毛片| 粉嫩av一区二区三区粉嫩| 美女视频黄免费的久久| 蜜乳av一区二区| 老色鬼精品视频在线观看播放| 美女爽到高潮91| 国产精品亚洲视频| 成人av网在线| 欧美性大战久久久| 欧美老女人第四色| 91麻豆精品国产91久久久久久久久| 欧美精品日韩一本| 777亚洲妇女| 欧美精品一区二区久久久| 欧美大片一区二区| 日韩视频一区二区在线观看| 国产精品国产自产拍高清av王其| 国产精品欧美经典| 一区二区国产盗摄色噜噜| 亚洲成av人片一区二区梦乃| 天堂蜜桃一区二区三区 | 亚洲电影欧美电影有声小说| 日韩精品电影在线观看| 美女国产一区二区三区| 狠狠色狠狠色综合| 99久久久免费精品国产一区二区| 色婷婷av一区二区三区gif| 欧洲色大大久久| 欧美一区二区黄| 国产欧美综合在线| 亚洲风情在线资源站| 亚洲国产va精品久久久不卡综合| 久久精品国产**网站演员| 国产激情一区二区三区桃花岛亚洲| 99精品热视频| 欧美一区二区在线观看| 亚洲国产精品黑人久久久| 一个色妞综合视频在线观看| 免费在线观看不卡| 99re6这里只有精品视频在线观看 99re8在线精品视频免费播放 | 亚洲精品国产精品乱码不99| 亚洲同性同志一二三专区| 一区二区三区高清不卡| 久久国产视频网| 色爱区综合激月婷婷| 精品奇米国产一区二区三区| 亚洲美女在线一区| 国产一二精品视频| 欧美日韩免费一区二区三区| 日本一区二区成人在线| 日本伊人午夜精品| 91视视频在线观看入口直接观看www| 宅男在线国产精品| 亚洲精品视频免费看| 国产精品影视在线| 制服.丝袜.亚洲.另类.中文| 一区二区三区中文字幕电影| 国产一区二三区| 欧美色窝79yyyycom| 亚洲国产高清aⅴ视频| 亚洲午夜电影网| 91一区一区三区| 久久综合一区二区| 舔着乳尖日韩一区| 91久久免费观看| 国产精品进线69影院| 日韩av不卡一区二区| 色综合天天在线| 日本一区二区三区高清不卡| 乱中年女人伦av一区二区| 欧美少妇性性性| 亚洲精品国产精品乱码不99| av网站免费线看精品| 国产日韩欧美精品在线| 国精产品一区一区三区mba桃花 | 国产成人免费视频网站高清观看视频| 欧美日韩国产首页在线观看| 亚洲精选一二三| 99久久亚洲一区二区三区青草| 日本一区二区三区四区| 国产成人亚洲综合a∨猫咪| 精品国产乱码久久久久久久久| 婷婷夜色潮精品综合在线| 91国产免费观看| 一区二区三区国产精品| 在线精品视频免费观看| 亚洲精品伦理在线| 在线看国产一区二区| 一区二区三区四区av| 欧美亚洲日本国产| 亚洲国产成人91porn| 欧美电影一区二区三区| 七七婷婷婷婷精品国产| 日韩一区二区免费视频| 免费人成黄页网站在线一区二区| 欧美电影免费观看高清完整版在| 精品一区二区在线观看| 久久这里都是精品| 国产成人av电影| 成人欧美一区二区三区| 日本韩国欧美国产| 亚洲成av人片一区二区梦乃| 欧美一级专区免费大片| 国内不卡的二区三区中文字幕| 久久久五月婷婷| 99国产精品久久久久久久久久久| 日韩美女啊v在线免费观看| 欧美制服丝袜第一页| 日本中文字幕不卡| 久久久久久夜精品精品免费| 不卡的av网站| 亚洲网友自拍偷拍| 欧美日韩精品电影| 国精产品一区一区三区mba视频 | 精品少妇一区二区三区免费观看| 国产一区二区在线视频| 亚洲日本在线观看| 这里只有精品电影| 风流少妇一区二区| 一区二区免费视频| 久久影院视频免费|