bookxmlmarshaller.java

来自「OR Mapping工具」· Java 代码 · 共 52 行

JAVA
52
字号
package org.ephman.junit.generated;import org.ephman.xml.XmlNode;import java.util.Vector;/** * a XmlMarshaller for Book * @version Thu Jun 30 15:12:42 EDT 2005 * @author generated by Dave Knull */public class BookXmlMarshaller {	public static String marshal (Book book) {		return marshal (book, "Book", "");	}	public static String marshal (Book book, String node_name, String indent_tabs) {		StringBuffer result = new StringBuffer (indent_tabs).append ("<").append(node_name);		result.append (marshalAttributes (book));		String these_els =  marshalElements (book, indent_tabs+"\t");		if (these_els != null && these_els.length()>0) 			result.append (these_els).append ("\n").append (indent_tabs).append ("</").append (node_name).append (">\n");		else			result.append ("/>");		return result.toString ();	}	public static Book unmarshal (XmlNode thisNode) {		Book book = new Book ();		unmarshal (thisNode, book);		return book;	}	/** unmarshal passing Xmlnode + pre-formed	 * Book to populate	*/	public static void unmarshal (XmlNode thisNode, Book book) {	}	protected static String marshalAttributes (Book book) {		StringBuffer result = new StringBuffer ();		result.append (" title=\"").append (book.getTitle ());		result.append (" Isbn=\"").append (book.getIsbn ());		return result.toString ();	}	protected static String marshalElements (Book book, String indent_tabs) {		StringBuffer result = new StringBuffer (indent_tabs);		return result.toString ();	}}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?