poetxmlmarshaller.java
来自「OR Mapping工具」· Java 代码 · 共 53 行
JAVA
53 行
package org.ephman.junit.generated;import org.ephman.xml.XmlNode;import java.util.Vector;/** * a XmlMarshaller for Poet * @version Thu Jun 30 15:12:42 EDT 2005 * @author generated by Dave Knull */public class PoetXmlMarshaller { public static String marshal (Poet poet) { return marshal (poet, "Poet", ""); } public static String marshal (Poet poet, String node_name, String indent_tabs) { StringBuffer result = new StringBuffer (indent_tabs).append ("<").append(node_name); result.append (marshalAttributes (poet)); String these_els = marshalElements (poet, 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 Poet unmarshal (XmlNode thisNode) { Poet poet = new Poet (); unmarshal (thisNode, poet); return poet; } /** unmarshal passing Xmlnode + pre-formed * Poet to populate */ public static void unmarshal (XmlNode thisNode, Poet poet) { WriterXmlMarshaller.unmarshal (thisNode, poet); } protected static String marshalAttributes (Poet poet) { StringBuffer result = new StringBuffer (); result.append (WriterXmlMarshaller.marshalAttributes (poet)); return result.toString (); } protected static String marshalElements (Poet poet, String indent_tabs) { StringBuffer result = new StringBuffer (indent_tabs); result.append (WriterXmlMarshaller.marshalElements (poet, indent_tabs)); return result.toString (); }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?