public class ForestJaxbConverter extends Object implements ForestXmlConverter
Constructor and Description |
---|
ForestJaxbConverter() |
Modifier and Type | Method and Description |
---|---|
<T> T |
convertToJavaObject(String source,
Class<T> targetType)
将源数据转换为目标类型(Class)的java对象
|
<T> T |
convertToJavaObject(String source,
Type targetType)
将源数据转换为目标类型(Type)的java对象
|
Marshaller |
createMarshaller(JAXBContext jaxbContext,
String encoding) |
Unmarshaller |
createUnmarshaller(JAXBContext jaxbContext) |
String |
encodeToString(Object obj) |
public String encodeToString(Object obj)
encodeToString
in interface ForestEncoder
public <T> T convertToJavaObject(String source, Class<T> targetType)
ForestConverter
convertToJavaObject
in interface ForestConverter<String>
T
- 目标类型泛型source
- 源数据targetType
- 目标类型 (Class对象)public <T> T convertToJavaObject(String source, Type targetType)
ForestConverter
convertToJavaObject
in interface ForestConverter<String>
T
- 目标类型泛型source
- 源数据targetType
- 目标类型 (Type对象)public Marshaller createMarshaller(JAXBContext jaxbContext, String encoding)
public Unmarshaller createUnmarshaller(JAXBContext jaxbContext)
Copyright © 2020. All rights reserved.