public class XmlUtil extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static com.fasterxml.jackson.dataformat.xml.XmlMapper |
xmlMapper |
| 构造器和说明 |
|---|
XmlUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static String |
beanToXmlStr(Object input) |
static Map<String,Object> |
beanToXmlStrToMap(Object input) |
static void |
strToXmlFile(String str,
File fileName) |
static String |
xmlFileToString(String fileName) |
static <T> T |
xmlToBean(String input,
Class<T> cls) |
static org.dom4j.Document |
xmlToDocument(String xml) |
public static <T> T xmlToBean(String input, Class<T> cls) throws IOException
IOExceptionpublic static String beanToXmlStr(Object input) throws IOException
IOExceptionpublic static Map<String,Object> beanToXmlStrToMap(Object input) throws IOException
IOExceptionpublic static org.dom4j.Document xmlToDocument(String xml)
public static void strToXmlFile(String str, File fileName) throws IOException
IOExceptionCopyright © 2022. All rights reserved.