• 大小: 0.49M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-02-01
  • 标签: JavaBean  demo  java  Xml  AB  

资源简介

javabean与xml互转的demo

资源截图

代码片段和文件信息

package com.grgbanking;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import org.dom4j.Document;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;

import com.grgbanking.test.TestChildobject;
import com.grgbanking.test.Testxmlobject;

/**
 * JAVA对象转化为xml助手类
 * 本助手类只能把转化基本数据类型及数组类型,当然包括自定义类
 * @author cypei
 * @since 2011-04-12
 */
public class JavaToxmlHelper {

/**
 * 输出xml
 * @param obj   java对象
 * @param rootName xml根名称为空则系统采用默认root
 * @return
 */
public static String toxml(object objString rootName){
String xml = null;
if (obj != null){
Document doc = null;
SAXR

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-08-03 16:50  javabean与xml互转的demo\
     目录           0  2018-08-03 16:50  javabean与xml互转的demo\test\
     文件         981  2018-08-03 16:17  javabean与xml互转的demo\test\.classpath
     文件        1037  2018-08-03 15:39  javabean与xml互转的demo\test\.project
     目录           0  2018-08-03 16:50  javabean与xml互转的demo\test\.settings\
     文件         567  2018-08-03 15:39  javabean与xml互转的demo\test\.settings\.jsdtscope
     文件         364  2018-08-03 15:39  javabean与xml互转的demo\test\.settings\org.eclipse.jdt.core.prefs
     文件         464  2018-08-03 15:39  javabean与xml互转的demo\test\.settings\org.eclipse.wst.common.component
     文件         331  2018-08-03 15:39  javabean与xml互转的demo\test\.settings\org.eclipse.wst.common.project.facet.core.xml
     文件          49  2018-08-03 15:39  javabean与xml互转的demo\test\.settings\org.eclipse.wst.jsdt.ui.superType.container
     文件           6  2018-08-03 15:39  javabean与xml互转的demo\test\.settings\org.eclipse.wst.jsdt.ui.superType.name
     目录           0  2018-08-03 16:50  javabean与xml互转的demo\test\WebContent\
     目录           0  2018-08-03 16:50  javabean与xml互转的demo\test\WebContent\meta-INF\
     文件          39  2018-08-03 15:39  javabean与xml互转的demo\test\WebContent\meta-INF\MANIFEST.MF
     目录           0  2018-08-03 16:50  javabean与xml互转的demo\test\WebContent\WEB-INF\
     目录           0  2018-08-03 16:50  javabean与xml互转的demo\test\WebContent\WEB-INF\lib\
     文件      313898  2018-08-03 16:03  javabean与xml互转的demo\test\WebContent\WEB-INF\lib\dom4j-1.6.1.jar
     文件      226915  2018-08-03 16:17  javabean与xml互转的demo\test\WebContent\WEB-INF\lib\jaxen-1.1.1.jar
     目录           0  2018-08-03 16:50  javabean与xml互转的demo\test\build\
     目录           0  2018-08-03 16:50  javabean与xml互转的demo\test\build\classes\
     目录           0  2018-08-03 16:50  javabean与xml互转的demo\test\build\classes\com\
     目录           0  2018-08-03 16:50  javabean与xml互转的demo\test\build\classes\com\grgbanking\
     文件        5955  2018-08-03 16:19  javabean与xml互转的demo\test\build\classes\com\grgbanking\JavaToxmlHelper.class
     文件        9360  2018-08-03 16:19  javabean与xml互转的demo\test\build\classes\com\grgbanking\xmlToJavaHelper.class
     目录           0  2018-08-03 16:50  javabean与xml互转的demo\test\build\classes\com\grgbanking\test\
     文件         854  2018-08-03 16:19  javabean与xml互转的demo\test\build\classes\com\grgbanking\test\TestChildobject.class
     文件        3762  2018-08-03 16:19  javabean与xml互转的demo\test\build\classes\com\grgbanking\test\Testxmlobject.class
     目录           0  2018-08-03 16:50  javabean与xml互转的demo\test\src\
     目录           0  2018-08-03 16:50  javabean与xml互转的demo\test\src\com\
     目录           0  2018-08-03 16:50  javabean与xml互转的demo\test\src\com\grgbanking\
     文件        5116  2018-08-03 15:40  javabean与xml互转的demo\test\src\com\grgbanking\JavaToxmlHelper.java
............此处省略4个文件信息

评论

共有 条评论