Class MGL_XMLUtils

java.lang.Object
tech.mgl.core.utils.MGL_XMLUtils

public class MGL_XMLUtils extends Object
ClassName: XMLUtils
Author:
hotpot ...
  • Constructor Details

    • MGL_XMLUtils

      public MGL_XMLUtils()
  • Method Details

    • parseToMap

      public static Map<String,Object> parseToMap(String xml) throws Exception

      @title : 把XML格式的字符串转换成MAP

      @param xml

      @return

      @throws Exception

      @company :

      @author : www.mgl.tech

      @date : 2016 Apr 23, 2016 10:56:54 AM

      @description :

      @return : Mapinvalid input: '<'String,Object>

      Throws:
      Exception
    • parseToBean

      public static <T> T parseToBean(String xml, Class<T> type) throws Exception

      @title : 把XML格式的字符串转换成BEAN对象,只转第一层属性,里面有集合或者嵌套无效

      @param xml

      @param t

      @throws Exception

      @company :

      @author : www.mgl.tech

      @date : 2016 Apr 25, 2016 10:29:57 AM

      @description :

      @return : void

      Throws:
      Exception
    • test

      public void test()
    • main

      public static void main(String[] strs)
    • getPostData

      public static String getPostData()
    • toXml

      public static <T> String toXml(T t)