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

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

?? documentserializableutilities.java

?? jxta平臺的開發包
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/* * Copyright (c) 2001 Sun Microsystems, Inc.  All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *    notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *    notice, this list of conditions and the following disclaimer in *    the documentation and/or other materials provided with the *    distribution. * * 3. The end-user documentation included with the redistribution, *    if any, must include the following acknowledgment: *       "This product includes software developed by the *       Sun Microsystems, Inc. for Project JXTA." *    Alternately, this acknowledgment may appear in the software itself, *    if and wherever such third-party acknowledgments normally appear. * * 4. The names "Sun", "Sun Microsystems, Inc.", "JXTA" and "Project JXTA" must *    not be used to endorse or promote products derived from this *    software without prior written permission. For written *    permission, please contact Project JXTA at http://www.jxta.org. * * 5. Products derived from this software may not be called "JXTA", *    nor may "JXTA" appear in their name, without prior written *    permission of Sun. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED.  IN NO EVENT SHALL SUN MICROSYSTEMS OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of Project JXTA.  For more * information on Project JXTA, please see * <http://www.jxta.org/>. * * This license is based on the BSD license adopted by the Apache Foundation. * * $Id: DocumentSerializableUtilities.java,v 1.8 2006/06/19 18:27:35 bondolo Exp $ */package net.jxta.util.documentSerializable;import net.jxta.document.*;import net.jxta.exception.*;import net.jxta.util.*;import java.util.*;import java.io.*;/** **/public class DocumentSerializableUtilities {	// Fix-Me: I didn't implement byte, short or float	// Fix-Me: I didn't implement arrays, ie addInt(Element element, String tagName, int values[]), etc	/**	 * Creates a Structured XML Document containing the serialized object	 *	 * @return	The created Document 	 * @throws DocumentSerializationException if Unable to parse the serialized object.	 */		public static XMLDocument createStructuredXmlDocument(String docType, DocumentSerializable documentSerializable) throws DocumentSerializationException {			XMLDocument xmlDoc =(XMLDocument) StructuredDocumentFactory.newStructuredDocument(MimeMediaType.XMLUTF8, docType);			documentSerializable.serializeTo(xmlDoc);			return xmlDoc;	}	/**	 * Deeply copy an element into another element	 *	 * @param toElement The target Element	 * @param fromElement The source Element	 */		public static void copyChildren(Element toElement, Element fromElement) {		// for now ... a quicky use of another utility		StructuredDocument intoDoc = toElement.getRoot();		StructuredDocumentUtils.copyChildren(intoDoc, toElement, fromElement);	}	/**	 *  Add an Element with the specified tagname and value (converted to a String)	 *	 * @param element Parent Element that the new child element will be added to	 * @param tagName TagName to be used for the created Child Element	 * @param documentSerializable This value will be serialized into the created child element\ 	 * @throws DocumentSerializationException if Unable to serialized object.	 **/	public static void addDocumentSerializable(Element element, String tagName, DocumentSerializable documentSerializable)  throws DocumentSerializationException {		StructuredDocument structuredDocument = (StructuredDocument) element.getRoot();		Element childElement = structuredDocument.createElement(tagName);		element.appendChild(childElement);		documentSerializable.serializeTo(childElement);	}	/**	 *  Create an object from its Document Serialized components	 *	 * @param element The relative root element of a Document Serialized Object	 * @param clazz The Class of the resurrected object (must implement DocumentSerializable and have a public no-arg constructor)	 * @return An object of type 'clazz' 	 * @throws DocumentSerializationException if Unable to parse the serialized object.	 **/	public static DocumentSerializable getDocumentSerializable(Element element, Class clazz) throws DocumentSerializationException {		try {			return getDocumentSerializable(element, (DocumentSerializable) clazz.newInstance());		} catch (DocumentSerializationException e) {			throw e;		} catch (Exception e) {			throw new DocumentSerializationException("Class must have a public no-arg constructor", e);		}	}		/**	 *  Initialize an object from its Document Serialized components	 *	 * @param element The relative root element of a Document Serialized Object	 * @param documentSerializable The object that will be populated from the Element	 * @return The same parameter passed to it 'documentSerializable' 	 * @throws DocumentSerializationException if Unable to parse the serialized object.	 **/	public static DocumentSerializable getDocumentSerializable(Element element, DocumentSerializable documentSerializable) throws DocumentSerializationException {		documentSerializable.initializeFrom(element);		return documentSerializable;	}	/**	 *  Create an object from its Document Serialized components	 *	 * @param element The Parent element which has a child Element with the serialized value	 * @param tagName The tagname of the element that contains the relative root element of a Document Serialized Object	 * @param clazz The Class of the resurrected object (must implement DocumentSerializable and have a public no-arg constructor)	 * @return An object of type 'clazz' 	 * @throws DocumentSerializationException if Unable to parse the serialized object.	 **/	public static DocumentSerializable getDocumentSerializable(Element element, String tagName, Class clazz) throws DocumentSerializationException {		Element childElement = getChildElement(element, tagName);				if (childElement != null)			return getDocumentSerializable(childElement, clazz);		else			return null;	}			/**	 *  Create a copy of any Document Serializable object.	 *  	 *  This is done by serializing and then deserializing the object (ie not very efficient)	 *	 * @param documentSerializable The Object to be copied	 * @return An copy of the presented object 	 * @throws DocumentSerializationException if Unable to serialize or parse object.	 **/	public static DocumentSerializable copyDocumentSerializable(DocumentSerializable documentSerializable) throws DocumentSerializationException {		StructuredDocument structuredDocument = createStructuredXmlDocument("temp", documentSerializable);		return getDocumentSerializable(structuredDocument, documentSerializable.getClass());	}	/**	 *  Create a child element of the specified tagName	 *  	 *  This is done by serializing and then deserializing the object (ie not very efficient)	 *	 * @param element The Parent Element	 * @param tagName The Tag Name for the new Element	 * @return The created Element	 **/	public static Element createChildElement(Element element, String tagName) {		StructuredDocument structuredDocument = (StructuredDocument) element.getRoot();		Element childElement = structuredDocument.createElement(tagName);		element.appendChild(childElement);		return childElement;	}	/**	 *  Get a child element of the specified tagName	 *  	 *  This is done by serializing and then deserializing the object (ie not very efficient)	 *	 * @param element The Parent Element	 * @param tagName The Tag Name for the new Element	 * @return The found Element	 **/	public static Element getChildElement(Element element, String tagName) {		Enumeration e = element.getChildren(tagName);				if (e.hasMoreElements())			return (Element) e.nextElement();		else			return null;	}	/**	 *  Add an Element with the specified tagname and value (converted to a String)	 *	 * @param element Parent Element that the new element will be added to	 * @param tagName TagName to be used for the created Child Element	 * @param value The value that will be stored in the Element as a String	 **/	 	public static void addInt(Element element, String tagName, int value) {		StructuredDocument structuredDocument = (StructuredDocument) element.getRoot();		Element childElement = structuredDocument.createElement(tagName, Integer.toString(value));		element.appendChild(childElement);	}	/**	 *  Get  the value of an element converted from a String	 *	 * @param element Element that contains the value	 * @return the value converted from a String	 **/	public static int getInt(Element element) {		return Integer.parseInt((String) element.getValue());	}		/**	 *  Get the value of a Child Element 	 *	 * @param element The Parant Element	 * @param tagName The Tag Name of the Child Element that will contain the value	 * @param defaultValue The return value if there is no Child Element with that Tag Name	 * @return the value converted from a String	 **/	public static int getInt(Element element, String tagName, int defaultValue) {		Element childElement = getChildElement(element, tagName);				if (childElement != null)			return getInt(childElement);		else			return defaultValue;	}				/**	 *  Add an Element with the specified tagname and value (converted to a String)	 *	 * @param element Parent Element that the new element will be added to	 * @param tagName TagName to be used for the created Child Element	 * @param value The value that will be stored in the Element as a String	 **/	public static void addLong(Element element, String tagName, long value) {		StructuredDocument structuredDocument = (StructuredDocument) element.getRoot();		Element childElement = structuredDocument.createElement(tagName, Long.toString(value));		element.appendChild(childElement);	}	/**	 *  Get  the value of an element converted from a String	 *	 * @param element Element that contains the value	 * @return the value converted from a String	 **/	public static long getLong(Element element) {		return Long.parseLong((String) element.getValue());	}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文字幕av一区 二区| 色综合一个色综合亚洲| 欧美日韩在线播放三区| 亚洲三级理论片| 成人做爰69片免费看网站| 国产日韩欧美综合一区| 国产不卡在线播放| 欧美精选一区二区| 日韩中文字幕区一区有砖一区 | 国产精品全国免费观看高清| 麻豆91免费观看| 久久精品人人做人人综合 | 91小视频在线观看| 亚洲国产aⅴ成人精品无吗| 欧美一区二区三区影视| 国产福利一区在线| 亚洲一区二区三区国产| 久久综合久久综合亚洲| 99久久精品免费| 日韩电影网1区2区| 国产精品久久久久久亚洲毛片| 在线观看成人免费视频| 精品一区在线看| 亚洲色图都市小说| 精品国精品国产| 色吊一区二区三区| 久久精品国产在热久久| 亚洲欧美另类小说| 精品国产自在久精品国产| 91视视频在线直接观看在线看网页在线看| 婷婷久久综合九色综合绿巨人| 久久人人97超碰com| 91久久免费观看| 国产一区二区在线视频| 亚洲观看高清完整版在线观看 | 国产在线精品免费| 亚洲免费观看高清| 久久精品一级爱片| 欧美久久一区二区| 99国产精品久久| 国产精品正在播放| 日韩av成人高清| 一区二区三区免费在线观看| 国产欧美视频一区二区| 日韩三级电影网址| 欧美视频在线一区| 99国产精品久久久久| 国产精品99久久久久久久vr| 日韩中文字幕区一区有砖一区| 亚洲乱码国产乱码精品精小说 | 久久精品亚洲麻豆av一区二区 | 精品裸体舞一区二区三区| 在线免费av一区| 成人免费毛片app| 国产尤物一区二区在线| 麻豆国产精品777777在线| 亚洲成人www| 一区二区三区欧美亚洲| 中文字幕一区二区三区在线播放| 久久久久亚洲综合| 精品国产乱码久久久久久久久| 91麻豆精品国产91| 6080国产精品一区二区| 欧美日本一区二区| 欧美日韩你懂得| 欧美天堂亚洲电影院在线播放| 色综合久久久久综合体桃花网| 97久久精品人人做人人爽| 成人午夜激情影院| 99热国产精品| 色婷婷综合久色| 欧洲日韩一区二区三区| 欧美在线观看一区| 欧美美女直播网站| 9191久久久久久久久久久| 91麻豆精品国产91| 日韩精品一区二区三区老鸭窝 | 国产精品乱人伦中文| 国产清纯白嫩初高生在线观看91| 久久精品人人爽人人爽| 国产日韩v精品一区二区| 久久这里都是精品| 中文字幕高清不卡| 1024成人网色www| 综合久久国产九一剧情麻豆| 亚洲天堂精品视频| 亚洲一区二区欧美激情| 日本亚洲欧美天堂免费| 麻豆成人久久精品二区三区小说| 麻豆国产精品一区二区三区 | 午夜免费久久看| 日韩成人一区二区| 韩国欧美国产1区| 成人午夜在线播放| 欧美亚洲一区二区在线| 日韩视频免费观看高清在线视频| 久久综合狠狠综合久久激情| 国产精品久久久久久久久快鸭| 亚洲女同一区二区| 青青草91视频| 国产成人免费高清| 欧美影视一区二区三区| 欧美不卡一区二区三区四区| 国产精品卡一卡二| 亚洲成av人片在线| 国产激情视频一区二区三区欧美 | 欧美性大战久久| 日韩欧美综合在线| 亚洲欧洲精品成人久久奇米网| 亚洲国产美女搞黄色| 久久er精品视频| 99视频在线精品| 日韩丝袜美女视频| 亚洲人精品一区| 精品一区二区在线观看| 色悠悠久久综合| 久久影音资源网| 亚洲午夜精品一区二区三区他趣| 紧缚捆绑精品一区二区| 在线视频一区二区三区| www久久久久| 亚洲国产精品精华液网站| 国产经典欧美精品| 欧美精品国产精品| 国产精品久久久一本精品| 日本欧美在线观看| 一本久久a久久精品亚洲| 久久久亚洲精品石原莉奈 | 国产精品美女久久久久久久网站| 亚洲成av人影院在线观看网| 岛国精品一区二区| 精品日韩成人av| 亚洲综合久久久久| a级精品国产片在线观看| 精品捆绑美女sm三区| 亚洲福利一二三区| 91麻豆免费视频| 国产蜜臀av在线一区二区三区| 蜜桃精品在线观看| 欧美日韩三级一区二区| 日韩美女精品在线| 成人精品鲁一区一区二区| 日韩精品一区二区三区在线观看 | 日韩一区在线免费观看| 久久国产人妖系列| 欧美日韩大陆一区二区| 日韩一区在线看| 成人性生交大片免费看中文网站| 日韩一区二区在线观看视频| 亚洲成人黄色影院| 欧美在线你懂的| 一区二区三区四区不卡在线 | 日韩制服丝袜av| 欧美日韩在线播放一区| 一区二区三区视频在线看| bt欧美亚洲午夜电影天堂| 中文字幕第一区| 国产不卡视频一区二区三区| 久久这里只精品最新地址| 伦理电影国产精品| 日韩欧美国产不卡| 免费av成人在线| 91精品国产综合久久福利软件| 婷婷丁香激情综合| 欧美疯狂做受xxxx富婆| 偷偷要91色婷婷| 欧美日本不卡视频| 亚洲3atv精品一区二区三区| 欧美三级欧美一级| 日韩国产在线一| 欧美变态tickle挠乳网站| 久久99精品国产.久久久久| 久久中文字幕电影| 国产成人免费视频网站| 亚洲欧美怡红院| 色爱区综合激月婷婷| 亚洲成人动漫在线免费观看| 欧美高清一级片在线| 日韩av中文字幕一区二区| 日韩一区二区三区四区五区六区| 精品亚洲国内自在自线福利| 久久精品欧美日韩精品| 99亚偷拍自图区亚洲| 一区二区三区视频在线观看| 欧美人狂配大交3d怪物一区| 琪琪久久久久日韩精品| 91精品国产入口| 国产高清视频一区| 亚洲精品日韩专区silk| 欧美高清激情brazzers| 免费在线观看日韩欧美| 国产亚洲福利社区一区| 91麻豆精东视频| 日本中文字幕不卡| 欧美激情在线观看视频免费| 色噜噜狠狠成人网p站| 免费成人在线播放| 1000精品久久久久久久久| 制服.丝袜.亚洲.中文.综合| 国产成人在线视频播放|