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

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

?? configparser.java

?? iso8583協議的java實現
?? JAVA
字號:
/*j8583 A Java implementation of the ISO8583 protocolCopyright (C) 2007 Enrique Zamudio LopezThis library is free software; you can redistribute it and/ormodify it under the terms of the GNU Lesser General PublicLicense as published by the Free Software Foundation; eitherversion 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 ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNULesser General Public License for more details.You should have received a copy of the GNU Lesser General PublicLicense along with this library; if not, write to the Free SoftwareFoundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA*/package com.solab.iso8583.parse;import java.io.IOException;import java.io.InputStream;import java.net.URL;import java.util.HashMap;import javax.xml.parsers.DocumentBuilder;import javax.xml.parsers.DocumentBuilderFactory;import javax.xml.parsers.ParserConfigurationException;import org.apache.commons.logging.Log;import org.apache.commons.logging.LogFactory;import org.w3c.dom.Document;import org.w3c.dom.Element;import org.w3c.dom.NodeList;import org.xml.sax.SAXException;import com.solab.iso8583.IsoMessage;import com.solab.iso8583.IsoType;import com.solab.iso8583.MessageFactory;/** This class is used to parse a XML configuration file and configure * a MessageFactory with the values from it. *  * @author Enrique Zamudio */public class ConfigParser {	private final static Log log = LogFactory.getLog(ConfigParser.class);	/** Creates a message factory configured from the default file, which is j8583.xml	 * located in the root of the classpath. */	public static MessageFactory createDefault() throws IOException {		if (MessageFactory.class.getClassLoader().getResource("j8583.xml") == null) {			log.warn("j8583.xml not found, returning empty message factory");			return new MessageFactory();		} else {			return createFromClasspathConfig("j8583.xml");		}	}	/** Creates a message factory from the specified path inside the classpath. */	public static MessageFactory createFromClasspathConfig(String path) throws IOException {		InputStream ins = MessageFactory.class.getClassLoader().getResourceAsStream(path);		MessageFactory mfact = new MessageFactory();		if (ins != null) {			if (log.isDebugEnabled()) {				log.debug("Parsing config from classpath file " + path);			}			try {				parse(mfact, ins);			} finally {				ins.close();			}		} else {			log.warn("File not found in classpath: " + path);		}		return mfact;	}	/** Creates a message factory from the file located at the specified URL. */	public static MessageFactory createFromUrl(URL url) throws IOException {		MessageFactory mfact = new MessageFactory();		InputStream stream = url.openStream();		try {			parse(mfact, stream);		} finally {			stream.close();		}		return mfact;	}	/** Reads the XML from the stream and configures the message factory with its values.	 * @param mfact The message factory to be configured with the values read from the XML.	 * @param stream The InputStream containing the XML configuration. */	protected static void parse(MessageFactory mfact, InputStream stream) throws IOException {		final DocumentBuilderFactory docfact = DocumentBuilderFactory.newInstance();		DocumentBuilder docb = null;		Document doc = null;		try {			docb = docfact.newDocumentBuilder();			doc = docb.parse(stream);		} catch (ParserConfigurationException ex) {			log.error("Cannot parse XML configuration", ex);			return;		} catch (SAXException ex) {			log.error("Parsing XML configuration", ex);			return;		}		final Element root = doc.getDocumentElement();		//Read the ISO headers		NodeList nodes = root.getElementsByTagName("header");		Element elem = null;		for (int i = 0; i < nodes.getLength(); i++) {			elem = (Element)nodes.item(i);			int type = parseType(elem.getAttribute("type"));			if (type == -1) {				throw new IOException("Invalid type for header: " + elem.getAttribute("type"));			}			if (elem.getChildNodes() == null || elem.getChildNodes().getLength() == 0) {				throw new IOException("Invalid header element");			}			String header = elem.getChildNodes().item(0).getNodeValue();			if (log.isTraceEnabled()) {				log.trace("Adding ISO header for type " + elem.getAttribute("type") + ": " + header);			}			mfact.setIsoHeader(type, header);		}		//Read the message templates		nodes = root.getElementsByTagName("template");		for (int i = 0; i < nodes.getLength(); i++) {			elem = (Element)nodes.item(i);			int type = parseType(elem.getAttribute("type"));			if (type == -1) {				throw new IOException("Invalid type for template: " + elem.getAttribute("type"));			}			NodeList fields = elem.getElementsByTagName("field");			IsoMessage m = new IsoMessage();			m.setType(type);			for (int j = 0; j < fields.getLength(); j++) {				Element f = (Element)fields.item(j);				int num = Integer.parseInt(f.getAttribute("num"));				IsoType itype = IsoType.valueOf(f.getAttribute("type"));				int length = 0;				if (f.getAttribute("length").length() > 0) {					length = Integer.parseInt(f.getAttribute("length"));				}				String v = f.getChildNodes().item(0).getNodeValue();				m.setValue(num, v, itype, length);			}			mfact.addMessageTemplate(m);		}		//Read the parsing guides		nodes = root.getElementsByTagName("parse");		for (int i = 0; i < nodes.getLength(); i++) {			elem = (Element)nodes.item(i);			int type = parseType(elem.getAttribute("type"));			if (type == -1) {				throw new IOException("Invalid type for parse guide: " + elem.getAttribute("type"));			}			NodeList fields = elem.getElementsByTagName("field");			HashMap parseMap = new HashMap();			for (int j = 0; j < fields.getLength(); j++) {				Element f = (Element)fields.item(j);				Integer num = new Integer(f.getAttribute("num"));				IsoType itype = IsoType.valueOf(f.getAttribute("type"));				int length = 0;				if (f.getAttribute("length").length() > 0) {					length = Integer.parseInt(f.getAttribute("length"));				}				parseMap.put(num, new FieldParseInfo(itype, length));			}			mfact.setParseMap(new Integer(type), parseMap);		}	}	/** Parses a message type expressed as a hex string and returns the integer number.	 * For example, "0200" or "200" return the number 512 (0x200) */	private static int parseType(String type) throws IOException {		if (type.length() % 2 == 1) {			type = "0" + type;		}		if (type.length() != 4) {			return -1;		}		return ((type.charAt(0) - 48) << 12) | ((type.charAt(1) - 48) << 8)			| ((type.charAt(2) - 48) << 4) | (type.charAt(3) - 48);	}}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美亚洲一区三区| 性做久久久久久久免费看| 欧美日韩三级视频| 色94色欧美sute亚洲线路一ni| 国产a精品视频| 国产91精品精华液一区二区三区| 国产伦精品一区二区三区免费| 美女一区二区在线观看| 玖玖九九国产精品| 九色|91porny| 国产精品一品二品| youjizz国产精品| 色婷婷综合久久久| 欧洲亚洲精品在线| 欧美高清dvd| 精品三级在线看| 日本一区二区免费在线| 国产精品丝袜黑色高跟| 最新久久zyz资源站| 亚洲男同1069视频| 天使萌一区二区三区免费观看| 日韩中文字幕91| 国产一区啦啦啦在线观看| 国产ts人妖一区二区| 91免费观看国产| 欧美精品日韩一本| 久久看人人爽人人| 一区二区在线观看视频| 天堂一区二区在线免费观看| 精品一区二区三区蜜桃| av动漫一区二区| 欧美肥妇bbw| 国产拍欧美日韩视频二区| 亚洲男人的天堂在线观看| 午夜一区二区三区在线观看| 日本欧美在线看| 成人黄页在线观看| 在线视频中文字幕一区二区| 日韩久久精品一区| 樱桃视频在线观看一区| 久久99精品国产91久久来源| 成人av手机在线观看| 欧美喷潮久久久xxxxx| 久久久亚洲精品石原莉奈| 亚洲在线免费播放| 国产aⅴ精品一区二区三区色成熟| 91福利精品视频| 国产亚洲欧美色| 午夜视频在线观看一区二区三区| 国产成人精品免费看| 欧美日韩久久一区| 国产精品第13页| 麻豆91在线看| 欧美视频日韩视频在线观看| 久久婷婷成人综合色| 天天亚洲美女在线视频| 91美女片黄在线观看| 91精品在线麻豆| 亚洲乱码国产乱码精品精的特点| 狠狠色丁香久久婷婷综合_中| 欧美亚洲综合网| 日韩理论片中文av| 成人永久免费视频| 久久久影视传媒| 久久电影网站中文字幕| 欧美伦理影视网| 亚洲国产人成综合网站| 色哟哟国产精品免费观看| 中文一区二区在线观看| 精品一区二区三区久久| 日韩欧美一区中文| 丝袜亚洲另类丝袜在线| 欧美人牲a欧美精品| 夜夜嗨av一区二区三区网页| 成人三级伦理片| 中文字幕第一区第二区| 丁香天五香天堂综合| 国产三级欧美三级日产三级99| 麻豆精品一区二区| 日韩一级免费观看| 美女在线视频一区| 欧美精品一区二区三区很污很色的| 午夜欧美2019年伦理| 欧美日韩视频在线观看一区二区三区 | 久久天天做天天爱综合色| 日韩av在线发布| 欧美成人精品高清在线播放| 麻豆国产欧美日韩综合精品二区| 欧美一区2区视频在线观看| 日韩成人精品在线观看| 日韩欧美不卡在线观看视频| 精品一区二区三区久久| 国产性天天综合网| 91在线视频18| 亚洲综合在线第一页| 欧美一区二区视频免费观看| 久久国产乱子精品免费女| 2014亚洲片线观看视频免费| 国产aⅴ综合色| 亚洲一二三四久久| 日韩一区二区在线看片| 国产麻豆午夜三级精品| 国产精品久久毛片| 欧美日韩免费一区二区三区| 奇米精品一区二区三区在线观看一| 日韩一级片网站| 成人动漫视频在线| 亚洲成人黄色影院| 久久色.com| 欧洲一区二区三区在线| 精品一区二区三区免费播放| 中文字幕一区二区三区视频| 精品视频1区2区| 国产精品一区二区三区四区| 亚洲美女偷拍久久| 2023国产精品视频| 欧美少妇bbb| 国产iv一区二区三区| 婷婷六月综合网| 中文无字幕一区二区三区| 欧美日韩精品一区二区三区| 粉嫩嫩av羞羞动漫久久久| 午夜电影一区二区| 亚洲欧美综合色| 精品三级在线看| 欧美日韩你懂得| 99在线精品观看| 国产精品456| 美女一区二区三区| 亚洲自拍另类综合| 国产精品少妇自拍| 精品久久久网站| 91精品国产综合久久香蕉麻豆| av日韩在线网站| 国产不卡一区视频| 精品亚洲成a人| 日本va欧美va精品| 亚洲小说春色综合另类电影| 欧美激情资源网| 精品久久国产字幕高潮| 欧美人伦禁忌dvd放荡欲情| 91在线观看一区二区| 成人高清视频免费观看| 国产真实乱对白精彩久久| 蜜臀av国产精品久久久久| 香蕉成人啪国产精品视频综合网| 樱桃国产成人精品视频| 亚洲精品亚洲人成人网在线播放| 中文字幕第一区二区| 久久精品综合网| 国产日韩精品一区二区三区| 欧美大胆一级视频| 日韩美女在线视频| 日韩免费看的电影| 精品国产乱子伦一区| 精品国产在天天线2019| 2020国产精品久久精品美国| 日韩美女视频在线| 精品欧美黑人一区二区三区| 日韩一区二区三区在线观看| 日韩欧美成人午夜| 久久综合狠狠综合久久综合88| 精品免费一区二区三区| 亚洲精品在线三区| 久久亚洲精精品中文字幕早川悠里 | 亚洲精品久久久久久国产精华液| 中文字幕 久热精品 视频在线| 国产精品色呦呦| 亚洲天天做日日做天天谢日日欢| 中文字幕一区二区5566日韩| 日韩美女精品在线| 亚洲一区二区中文在线| 五月天国产精品| 精品一区在线看| 国产成人精品综合在线观看| 99视频有精品| 在线成人免费视频| 精品999久久久| 国产精品久久久久天堂| 亚洲激情自拍视频| 日本不卡一区二区三区高清视频| 久久丁香综合五月国产三级网站| 国产成人一区在线| 色呦呦国产精品| 欧美一级艳片视频免费观看| 久久精品亚洲国产奇米99| 亚洲欧洲av在线| 青青草国产成人av片免费| 国产伦精品一区二区三区在线观看| av在线综合网| 日韩视频在线观看一区二区| 26uuu久久天堂性欧美| 亚洲免费观看高清完整版在线| 日本视频免费一区| 99精品欧美一区二区三区综合在线| 欧美日韩一区二区不卡| 国产日产欧产精品推荐色| 亚洲一区二区三区在线播放| 黑人精品欧美一区二区蜜桃| 色综合久久久久久久久|