public class JsonMapper<T> extends Object
| 限定符和类型 | 类和说明 |
|---|---|
static class |
JsonMapper.ArrayBind |
protected class |
JsonMapper.Builder |
static interface |
JsonMapper.Converter
转换器
|
static class |
JsonMapper.Element
注解映射属性项
|
static interface |
JsonMapper.Inherited
用于标识继承父类的注解
|
static class |
JsonMapper.NodeBind<T> |
| 限定符和类型 | 字段和说明 |
|---|---|
protected static Map<Class<?>,JsonMapper<?>> |
_Cache |
protected static Map<Class<?>,JsonMapper<?>> |
_CacheForFormat |
static JsonMapper.Converter |
_DefaultConverter |
protected static org.slf4j.Logger |
_Logger |
protected Class<T> |
m_Clazz
PO类
|
protected JsonMapper.Converter |
m_Converter |
protected JsonMapper.Element[] |
m_Elements
有注解要映射的属性
|
| 限定符 | 构造器和说明 |
|---|---|
protected |
JsonMapper(Class<T> clazz,
JsonMapper.Element[] items,
JsonMapper.Converter converter) |
protected static final Map<Class<?>,JsonMapper<?>> _CacheForFormat
protected static final Map<Class<?>,JsonMapper<?>> _Cache
protected static final org.slf4j.Logger _Logger
protected final JsonMapper.Element[] m_Elements
protected JsonMapper.Converter m_Converter
public static final JsonMapper.Converter _DefaultConverter
protected JsonMapper(Class<T> clazz, JsonMapper.Element[] items, JsonMapper.Converter converter)
public static <T> JsonMapper<T> getInstance(Class<T> clazz)
protected <TYPE> JsonMapper<TYPE> getMapper(Class<TYPE> clazz)
protected static boolean isExist(List<JsonMapper.Element> items, JsonMapper.Element field)
public static <T> List<JsonMapper.Element> load(Class<T> clazz, boolean allFields)
public JsonMapper<T> getInstance(JsonMapper.Converter converter)
public void toJson(T po, OutputStream out) throws IOException
IOExceptionpublic String toJson(T po) throws IOException
IOExceptionprotected boolean putValue(Object v, JsonOutput out, boolean withoutNull) throws IOException
IOExceptionprotected boolean putElement(String name, Object v, JsonOutput out, boolean withoutNull) throws IOException
IOExceptionpublic void toJson(T po, JsonOutput out, boolean withoutNull) throws IOException
IOExceptionpublic T fromJson(InputStream in) throws IOException
IOExceptionpublic Iterable<T> fromJson(Iterator<InputStream> iss) throws IOException
IOExceptionprotected T loadObject(JsonObject json) throws IOException
IOExceptionprotected Object convert(Object v, Class<?> type) throws IOException
IOExceptionprotected JsonMapper.Element getElement(String name)
protected Object loadArray(JsonArray array, Class<?> type, Class<?> component) throws IOException
IOExceptionpublic T fromJson(JsonInput in) throws IOException
IOExceptionpublic JsonUtil.NodeBuilderExt createBuilder()
public JsonMapper.NodeBind<T> createNode()
Copyright © 2022. All rights reserved.