public class BeanXmlUtil extends Object
| 构造器和说明 |
|---|
BeanXmlUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static <T> String |
marshal(T element) |
static <T> String |
marshal(T element,
String charset) |
static <T> T |
unmarshal(Class<T> c,
InputStream is) |
static <T> T |
unmarshal(Class<T> c,
InputStream is,
String charset)
XML对象转JAVA对象
|
static <T> T |
unmarshal(Class<T> c,
String xml)
XML对象转JAVA对象
|
public static <T> String marshal(T element)
public static <T> String marshal(T element, String charset)
element - JAXBExceptionIOExceptionpublic static <T> T unmarshal(Class<T> c, String xml)
c - xml - JAXBExceptionpublic static <T> T unmarshal(Class<T> c, InputStream is, String charset)
c - is - JAXBExceptionpublic static <T> T unmarshal(Class<T> c, InputStream is) throws JAXBException
JAXBExceptionCopyright © 2021. All rights reserved.