public class JaxbMapper extends Object
限定符和类型 | 类和说明 |
---|---|
static class |
JaxbMapper.CollectionWrapper
封装Root Element 是 Collection的情况.
|
构造器和说明 |
---|
JaxbMapper(Class<?>... rootTypes) |
限定符和类型 | 方法和说明 |
---|---|
Marshaller |
createMarshaller(String encoding)
创建Marshaller并设定encoding(可为null).
|
Unmarshaller |
createUnmarshaller()
创建UnMarshaller.
|
<T> T |
fromXml(String xml)
Xml->Java Object.
|
String |
toXml(Collection<?> root,
String rootName)
Java Object->Xml without encoding, 特别支持Root Element是Collection的情形.
|
String |
toXml(Collection<?> root,
String rootName,
String encoding)
Java Object->Xml with encoding, 特别支持Root Element是Collection的情形.
|
String |
toXml(Object root)
Java Object->Xml without encoding.
|
String |
toXml(Object root,
String encoding)
Java Object->Xml with encoding.
|
public JaxbMapper(Class<?>... rootTypes)
rootTypes
- 所有需要序列化的Root对象的Class.public String toXml(Collection<?> root, String rootName)
public String toXml(Collection<?> root, String rootName, String encoding)
public <T> T fromXml(String xml)
public Marshaller createMarshaller(String encoding)
public Unmarshaller createUnmarshaller()
Copyright © 2014 EPIC Team. All rights reserved.