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

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

?? mappingprocessor.java

?? METAmorphoses is a system for flexible and easy-to-use generation of RDF metadata directly from a re
?? JAVA
字號:
package cz.cvut.felk.cs.metamorphoses.mapping;import java.io.IOException;import java.util.ArrayList;import java.util.List;import javax.xml.parsers.DocumentBuilder;import javax.xml.parsers.DocumentBuilderFactory;import org.w3c.dom.CDATASection;import org.w3c.dom.Document;import org.w3c.dom.Element;import org.w3c.dom.Node;import org.w3c.dom.NodeList;/** * <p>The main class of the mapping layer.</p> * @author Martin Svihla */public class MappingProcessor {	private static final String MAPPING_NS = "http://www.svihla.net/metamorphoses/mapping.dtd";		Document mapping;	String jdbcUrl;	String jdbcDriver;	String username;	String password;	/**	 * Create mapping connection instance (reads the mapping document from file and read database connection data)	 * @param mapping document filename Filename	 * @throws MappingProcessorException when processor initialization fails	 */	public MappingProcessor(String mappingFilename)		throws MappingProcessorException {		this.loadMapping(mappingFilename);		this.readDBConnection();	}	/**	 * Loads mapping document and builds DOM out of it.	 * @param mapping document filename filename 	 * @throws MappingProcessorException	 */	protected void loadMapping(String filename)		throws MappingProcessorException {		try {			DocumentBuilderFactory factory =				DocumentBuilderFactory.newInstance();			factory.setNamespaceAware(true);			DocumentBuilder builder = factory.newDocumentBuilder();			mapping = builder.parse(filename);		} catch (IOException e) {			throw new MappingProcessorException(filename + " not found.", e);		} catch (Exception e) {			throw new MappingProcessorException("Mapping document parsing failed.", e);		}	}	/*	public void readNS() {			NodeList list = this.mapping.getElementsByTagName("Namespace");			for (int i = 0; i < list.getLength(); i++) {				Element elem = (Element) list.item(i);				this.namespaces.put(					elem.getAttributeNS(MappingProcessor.MAPPING_NS, "prefix"),					elem.getAttributeNS(MappingProcessor.MAPPING_NS, "namespace"));			}		}	*/	/**	 * Returns content of header tag from mapping document. 	 * @return String content of RDF header.	 */	public String getHeader() {		NodeList list =			mapping.getElementsByTagNameNS(				MappingProcessor.MAPPING_NS,				MappingTags.DOCUMENT_HEADER);		Element elem = (Element) list.item(list.getLength() - 1);		return getCDataContent(elem);	}	/**	 * Returns content of foot tag from mapping document. 	 * @return String content of RDF footer.	 */	public String getFoot() {		NodeList list =			mapping.getElementsByTagNameNS(				MappingProcessor.MAPPING_NS,				MappingTags.DOCUMENT_FOOT);		Element elem = (Element) list.item(list.getLength() - 1);		return getCDataContent(elem);	}	/**	 * Gets content of CDATA from XML element	 * @param Element XML element	 * @return CDATA content	 */	private String getCDataContent(Element elem) {		String data = "";		if (elem != null) {			if ((elem.getChildNodes().item(1) != null)				& (elem.getChildNodes().item(1).getNodeType()					== Node.CDATA_SECTION_NODE)) {				CDATASection content =					(CDATASection) elem.getChildNodes().item(1);				data = content.getData();			}		}		return data;	}		/**	 * Reads database connection configuration from a mapping document.	 * @throws MappingProcessorException	 */	private void readDBConnection() throws MappingProcessorException {		NodeList db =			mapping.getElementsByTagNameNS(				MappingProcessor.MAPPING_NS,				MappingTags.DATABASE_CONNECTON);		if (db.getLength() == 0) {			throw new MappingProcessorException("No database connection tag in mapping.");		}		Element elem = (Element) db.item(db.getLength() - 1);		if (elem != null) {			if (elem.hasAttributeNS(MappingProcessor.MAPPING_NS, MappingTags.JDBC_URL))				this.jdbcUrl =					elem.getAttributeNS(MappingProcessor.MAPPING_NS, MappingTags.JDBC_URL);			if (elem.hasAttributeNS(MappingProcessor.MAPPING_NS, MappingTags.JDBC_DRIVER))				this.jdbcDriver =					elem.getAttributeNS(						MappingProcessor.MAPPING_NS,						MappingTags.JDBC_DRIVER);			if (elem.hasAttributeNS(MappingProcessor.MAPPING_NS, MappingTags.DB_USER))				this.username =					elem.getAttributeNS(						MappingProcessor.MAPPING_NS,						MappingTags.DB_USER);			if (elem.hasAttributeNS(MappingProcessor.MAPPING_NS, MappingTags.DB_PASSWORD))				this.password =					elem.getAttributeNS(						MappingProcessor.MAPPING_NS,						MappingTags.DB_PASSWORD);		}	}	/**	 * Creates list of all class names in the mapping (class name = template name in this case)	 * @return list of strings	 */	public List getAllClassNames() {		List nameList = new ArrayList();		NodeList classes =			mapping.getElementsByTagNameNS(				MappingProcessor.MAPPING_NS,				MappingTags.CLASS);		for (int i = 0, n = classes.getLength(); i < n; i++) {			Element elem = (Element) classes.item(i);			if (elem				.hasAttributeNS(MappingProcessor.MAPPING_NS, MappingTags.TEMPLATE_NAME)) {				nameList.add(					elem.getAttributeNS(						MappingProcessor.MAPPING_NS,						MappingTags.TEMPLATE_NAME));			}		}		return nameList;	}		/**	 * Processor returns MappingClass with a specified template name.	 * @param String template name	 * @return MappingClass	 */	public MappingClass getClassByTemplateName(String templateName) {		NodeList classes =			mapping.getElementsByTagNameNS(				MappingProcessor.MAPPING_NS,				MappingTags.CLASS);		Element elem, processedClass = null;		for (int i = 0, n = classes.getLength(); i < n; i++) {			elem = (Element) classes.item(i);			if (elem != null) {				if (elem					.hasAttributeNS(MappingProcessor.MAPPING_NS, MappingTags.TEMPLATE_NAME)					& (elem						.getAttributeNS(							MappingProcessor.MAPPING_NS,							MappingTags.TEMPLATE_NAME)						.equals(templateName))) {					processedClass = elem;					break;				}			}		}				if (processedClass == null)			return null;		String rdfLabel = null, sql = null;		if (processedClass			.hasAttributeNS(MappingProcessor.MAPPING_NS, MappingTags.RDF_LABEL)) {			rdfLabel =				processedClass.getAttributeNS(					MappingProcessor.MAPPING_NS,					MappingTags.RDF_LABEL);		}		if (processedClass.hasAttributeNS(MappingProcessor.MAPPING_NS, MappingTags.SQL))			sql =				processedClass.getAttributeNS(					MappingProcessor.MAPPING_NS,					MappingTags.SQL);		MappingClass mc = new MappingClass(templateName, rdfLabel, sql);		NodeList list;		//conditions		list =			processedClass.getElementsByTagNameNS(				MappingProcessor.MAPPING_NS,				MappingTags.CONDITION);		for (int i = 0, n = list.getLength(); i < n; i++) {			elem = (Element) list.item(i);			//try {			mc.getConditions().put(				elem.getAttributeNS(					MappingProcessor.MAPPING_NS,					MappingTags.TEMPLATE_NAME),				createCondition(elem));			//} catch (Exception e) {			//	throw new MappingProcessorException(			//		"Processing condition from class " + templateName,			//		e);			//}		}		// variables		list =			processedClass.getElementsByTagNameNS(				MappingProcessor.MAPPING_NS,				MappingTags.VARIABLE);		String variableName;		for (int i = 0, n = list.getLength(); i < n; i++) {			elem = (Element) list.item(i);			//try {			variableName =				elem.getAttributeNS(					MappingProcessor.MAPPING_NS,					MappingTags.TEMPLATE_NAME);			mc.getVariables().put(				variableName,				elem.getAttributeNS(MappingProcessor.MAPPING_NS, MappingTags.SQL_NAME));			//} catch (Exception e) {			//	throw new MappingProcessorException(			//		"Processing variable from class " + templateName,			//		e);			//}		}		// properties		list =			processedClass.getElementsByTagNameNS(				MappingProcessor.MAPPING_NS,				MappingTags.PROPERTY);		for (int i = 0, n = list.getLength(); i < n; i++) {			elem = (Element) list.item(i);			//try {			mc.getProperties().put(				elem.getAttributeNS(					MappingProcessor.MAPPING_NS,					MappingTags.TEMPLATE_NAME),				createProperty(elem));			//} catch (Exception e) {			//	throw new MappingProcessorException(			//		"Processing property from class " + templateName,			//		e);			//}		}		// attributes		mc.setAttributes(createAttributeList(processedClass));		return mc;	}			/**	 * Creates a MappingProperty object from XML element mmm:Property.	 * @param Element property element	 * @return created MappingProperty	 */	private MappingProperty createProperty(Element propertyElement) {		MappingProperty property;		//try {		String containerType = "";		if (propertyElement.hasAttributeNS(MappingProcessor.MAPPING_NS, MappingTags.CONTAINER_TYPE)) {			containerType = propertyElement.getAttributeNS(					MappingProcessor.MAPPING_NS,					MappingTags.CONTAINER_TYPE);		}		property =			new MappingProperty(				propertyElement.getAttributeNS(					MappingProcessor.MAPPING_NS,					MappingTags.RDF_LABEL),				propertyElement.getAttributeNS(					MappingProcessor.MAPPING_NS,					MappingTags.SQL_NAME),				propertyElement.getAttributeNS(							MappingProcessor.MAPPING_NS,							MappingTags.PREFIX),				propertyElement.getAttributeNS(							MappingProcessor.MAPPING_NS,							MappingTags.SUFFIX),							containerType,				createAttributeList(propertyElement));		//			} catch (Exception e) {		//				throw new MappingProcessorException(		//					"Processing property from class " + templateName,		//					e);		//			}		return property;	}	/**	 * Creates a MappingCondition object from XML element mmm:ClassCondition	 * @param Element property element	 * @return created MappingCondition	 */	private MappingCondition createCondition(Element elem) {		return new MappingCondition(			elem.getAttributeNS(MappingProcessor.MAPPING_NS, MappingTags.TEMPLATE_NAME),			elem.getAttributeNS(MappingProcessor.MAPPING_NS, MappingTags.SQL_WHERE_STRING),			elem.getAttributeNS(MappingProcessor.MAPPING_NS, MappingTags.SQL_TABLE_STRING),			elem.getAttributeNS(MappingProcessor.MAPPING_NS, MappingTags.COMMENT));	}	/**	 * Returns list of attributes of a MappingClass or MappingProperty object from XML element mmm:Class or mmm:Property	 * @param Element class or property element	 * @return List list of MappingAtributes	 */	private ArrayList createAttributeList(Element element) {		ArrayList attributes = new ArrayList();		NodeList list =			element.getElementsByTagNameNS(				MappingProcessor.MAPPING_NS,				MappingTags.ATTRIBUTE);		for (int i = 0, n = list.getLength(); i < n; i++) {			Element elem = (Element) list.item(i);			//elem.			if (elem.getParentNode().equals(element)) {				MappingAttribute ma =					new MappingAttribute(						elem.getAttributeNS(							MappingProcessor.MAPPING_NS,							MappingTags.RDF_LABEL),						elem.getAttributeNS(							MappingProcessor.MAPPING_NS,							MappingTags.SQL_NAME),						elem.getAttributeNS(							MappingProcessor.MAPPING_NS,							MappingTags.PREFIX),						elem.getAttributeNS(							MappingProcessor.MAPPING_NS,							MappingTags.SUFFIX));				attributes.add(ma);			}		}		return attributes;	}	/**	 * @return	 */	public String getJdbcDriver() {		return jdbcDriver;	}	/**	 * @return	 */	public String getJdbcUrl() {		return jdbcUrl;	}	/**	 * @return	 */	public String getPassword() {		return password;	}	/**	 * @return	 */	public String getUsername() {		return username;	}	/*	public static void main(String args[]) throws MappingProcessorException {		MappingProcessor proc = new MappingProcessor("resources/mapping1.xml");		proc.readDBConnection();		System.err.println(proc.jdbcDriver);		MappingClass mc = null;		//try {		mc = proc.getClassByTemplateName("person");		//} catch (MappingProcessorException e) {		//}		///System.out.println(mc.getSql());		///System.out.println(mc.getPropertyRdf().get("firstName"));	}	*/}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲不卡一区二区三区| 国产真实乱对白精彩久久| 久久影院午夜片一区| 一本久道久久综合中文字幕 | 一区二区三区日韩欧美精品 | 亚洲老司机在线| 2021国产精品久久精品| 欧美三级电影一区| av中文字幕不卡| 精品在线一区二区| 亚洲电影第三页| 亚洲人成精品久久久久久| 久久综合国产精品| 欧美xxxxx牲另类人与| 欧美性猛交xxxxxxxx| 99久久免费精品高清特色大片| 久久精品二区亚洲w码| 亚洲成人动漫在线免费观看| 亚洲视频在线观看一区| 国产亚洲成av人在线观看导航| 91精选在线观看| 欧美精品精品一区| 欧美色精品在线视频| 一道本成人在线| 91猫先生在线| a4yy欧美一区二区三区| 成人激情免费电影网址| 国产成人精品免费| 国产91丝袜在线18| 成人性生交大片免费看视频在线 | 日韩经典一区二区| 亚洲高清在线精品| 亚洲综合精品自拍| 亚洲午夜一区二区| 亚洲一区二区在线视频| 一级日本不卡的影视| 亚洲卡通动漫在线| 夜夜爽夜夜爽精品视频| 亚洲一区欧美一区| 午夜免费久久看| 天涯成人国产亚洲精品一区av| 亚洲精品v日韩精品| 亚洲宅男天堂在线观看无病毒| 亚洲精品国产视频| 亚洲成人7777| 蜜臀av国产精品久久久久| 久久精品国产精品亚洲综合| 奇米一区二区三区av| 国内一区二区在线| 高清在线成人网| 色综合久久久久综合| 欧美性淫爽ww久久久久无| 欧美二区在线观看| 精品成人一区二区三区四区| 国产女同互慰高潮91漫画| 国产精品久久久久久户外露出 | 69久久夜色精品国产69蝌蚪网| 欧美日韩国产高清一区二区三区| 欧美一级免费大片| 26uuu精品一区二区在线观看| 久久精品一二三| 亚洲精品乱码久久久久久久久 | 亚洲国产一区二区在线播放| 亚洲国产视频a| 日本不卡视频一二三区| 国产经典欧美精品| 欧美专区亚洲专区| 日韩女同互慰一区二区| 国产精品久线观看视频| 亚洲午夜精品在线| 国内一区二区视频| 色网站国产精品| 亚洲精品在线观看视频| 亚洲色图在线播放| 久久精品国产99| 91视频免费播放| 精品少妇一区二区三区日产乱码| 国产精品久久久久久久第一福利 | 久久久不卡影院| 亚洲美女视频一区| 久久国产精品免费| 91成人在线观看喷潮| 日韩欧美亚洲一区二区| 国产精品超碰97尤物18| 亚洲午夜一二三区视频| 国产精品中文字幕日韩精品 | 欧美变态凌虐bdsm| 亚洲色图制服丝袜| 韩国女主播成人在线观看| 日本精品裸体写真集在线观看| 精品黑人一区二区三区久久| 亚洲精品视频免费看| 国产在线播放一区三区四| 91美女在线视频| 国产免费观看久久| 久久99精品国产麻豆婷婷| 一本大道久久a久久综合婷婷| 亚洲精品在线网站| 日韩av一级片| 色女孩综合影院| 国产亚洲短视频| 日韩成人午夜精品| 在线观看av一区| 中文字幕欧美一区| 国产美女精品人人做人人爽 | 欧美二区乱c少妇| 亚洲欧美偷拍三级| 成人免费视频免费观看| 欧美大片在线观看一区二区| 亚洲一区在线视频| 99re热这里只有精品视频| 久久人人97超碰com| 日本欧美在线观看| 欧美日韩久久久久久| 亚洲卡通动漫在线| 制服视频三区第一页精品| 亚洲天堂免费在线观看视频| 国产精品一区二区久久不卡| 日韩一区二区三区电影在线观看| 亚洲香肠在线观看| 在线观看日产精品| 亚洲美女在线国产| 色噜噜狠狠色综合欧洲selulu| 国产精品每日更新| 国产成人免费xxxxxxxx| 精品av久久707| 国产一区二区三区在线观看精品 | 韩国毛片一区二区三区| 69堂亚洲精品首页| 日韩国产在线观看一区| 欧美肥妇毛茸茸| 青青青伊人色综合久久| 666欧美在线视频| 日本不卡视频在线观看| 日韩欧美激情一区| 极品少妇一区二区三区精品视频 | 91在线无精精品入口| 中文在线免费一区三区高中清不卡 | 亚洲麻豆国产自偷在线| 色婷婷久久综合| 亚洲午夜影视影院在线观看| 欧美视频在线观看一区| 午夜av一区二区| 日韩限制级电影在线观看| 久久激情五月激情| 欧美国产一区视频在线观看| 99久久国产免费看| 亚洲黄色小视频| 911精品国产一区二区在线| 男男视频亚洲欧美| 久久日一线二线三线suv| 国产夫妻精品视频| 日韩理论在线观看| 欧美午夜一区二区三区免费大片| 日韩精品久久理论片| 精品国产sm最大网站免费看| 成人动漫在线一区| 亚洲一卡二卡三卡四卡无卡久久| 欧美日本一区二区在线观看| 免费人成在线不卡| 欧美国产97人人爽人人喊| 色播五月激情综合网| 日日夜夜精品视频天天综合网| 久久综合色之久久综合| 99re这里只有精品视频首页| 性做久久久久久免费观看| 日韩久久久久久| 99久久精品免费观看| 天天影视色香欲综合网老头| 久久五月婷婷丁香社区| 91丨porny丨户外露出| 日本网站在线观看一区二区三区| 欧美激情一区在线观看| 欧美性视频一区二区三区| 精彩视频一区二区| 一级做a爱片久久| 国产性色一区二区| 在线看不卡av| 国产在线播放一区三区四| 亚洲一区二区在线视频| 久久久久久久久一| 欧美亚洲愉拍一区二区| 国产成人免费9x9x人网站视频| 亚洲国产精品尤物yw在线观看| 欧美精品一区二区精品网| 91蜜桃视频在线| 国产一区 二区 三区一级| 亚洲综合色婷婷| 欧美国产日韩一二三区| 91精品国产欧美一区二区成人| av亚洲产国偷v产偷v自拍| 蜜臀久久99精品久久久久宅男| 成人免费小视频| www国产成人| 91麻豆精品国产| 在线观看一区二区精品视频| 国产不卡在线一区| 美女网站色91| 视频一区二区不卡| 亚洲国产日日夜夜|