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