Package com.foxinmy.weixin4j.xml
Class XmlStream
- java.lang.Object
-
- com.foxinmy.weixin4j.xml.XmlStream
-
public final class XmlStream extends Object
XML 处理- Since:
- JDK 1.6
- Author:
- jinyu(foxinmy@gmail.com)
-
-
Constructor Summary
Constructors Constructor Description XmlStream()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> T
fromXML(InputStream content, Class<T> clazz)
Xml2Beanstatic <T> T
fromXML(String content, Class<T> clazz)
Xml2Beanstatic String
map2xml(com.alibaba.fastjson.JSONObject json)
map2xmlstatic String
map2xml(Map<String,String> map)
map2xmlstatic String
toXML(Object object)
Bean2Xmlstatic <T> void
toXML(T t, OutputStream os)
Bean2Xmlstatic Map<String,String>
xml2map(String content)
xml2map
-
-
-
Method Detail
-
fromXML
public static <T> T fromXML(InputStream content, Class<T> clazz)
Xml2Bean- Parameters:
content
- xml内容clazz
- bean类型- Returns:
-
fromXML
public static <T> T fromXML(String content, Class<T> clazz)
Xml2Bean- Parameters:
content
- xml内容clazz
- bean类型- Returns:
-
map2xml
public static String map2xml(Map<String,String> map)
map2xml- Parameters:
map
- value无嵌套的map- Returns:
- xml内容
-
map2xml
public static String map2xml(com.alibaba.fastjson.JSONObject json)
map2xml- Parameters:
json
- value无嵌套的json- Returns:
- xml内容
-
xml2map
public static Map<String,String> xml2map(String content)
xml2map- Parameters:
content
- 无嵌套节点的xml内容- Returns:
- map对象
-
toXML
public static String toXML(Object object)
Bean2Xml- Parameters:
object
- bean对象- Returns:
- xml内容
-
toXML
public static <T> void toXML(T t, OutputStream os)
Bean2Xml- Parameters:
t
- bean对象os
- 输出流
-
-