类 JaxbMapper
java.lang.Object
com.jeeplus.devtools.util.JaxbMapper
使用Jaxb2.0实现XML<->Java Object的Mapper.
在创建时需要设定所有需要序列化的Root对象的Class. 特别支持Root对象是Collection的情形.
- 版本:
- 2021-01-15
- 作者:
- calvin
-
嵌套类概要
嵌套类 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static jakarta.xml.bind.MarshallercreateMarshaller(Class clazz, String encoding) 创建Marshaller并设定encoding(可为null).static jakarta.xml.bind.UnmarshallercreateUnmarshaller(Class clazz) 创建UnMarshaller.static <T> TXml->Java Object.protected static jakarta.xml.bind.JAXBContextgetJaxbContext(Class clazz) static StringJava Object->Xml without encoding.static StringJava Object->Xml with encoding.static StringJava Object->Xml with encoding.static StringtoXml(Collection<?> root, String rootName, Class clazz) Java Collection->Xml without encoding, 特别支持Root Element是Collection的情形.static StringtoXml(Collection<?> root, String rootName, Class clazz, String encoding) Java Collection->Xml with encoding, 特别支持Root Element是Collection的情形.
-
构造器详细资料
-
JaxbMapper
public JaxbMapper()
-
-
方法详细资料
-
toXml
Java Object->Xml without encoding. -
toXml
Java Object->Xml with encoding. -
toXml
Java Object->Xml with encoding. -
toXml
Java Collection->Xml without encoding, 特别支持Root Element是Collection的情形. -
toXml
Java Collection->Xml with encoding, 特别支持Root Element是Collection的情形. -
fromXml
Xml->Java Object. -
createMarshaller
创建Marshaller并设定encoding(可为null). 线程不安全,需要每次创建或pooling。 -
createUnmarshaller
创建UnMarshaller. 线程不安全,需要每次创建或pooling。 -
getJaxbContext
-