org.test4j.json.decoder.base
类 MapPoJoBaseDecoder<E>

java.lang.Object
  继承者 org.test4j.json.decoder.base.BaseDecoder
      继承者 org.test4j.json.decoder.base.MapPoJoBaseDecoder<E>
所有已实现的接口:
IDecoder
直接已知子类:
MapDecoder, PoJoDecoder

public abstract class MapPoJoBaseDecoder<E>
extends BaseDecoder


构造方法摘要
MapPoJoBaseDecoder()
           
 
方法摘要
<T> T
decode(JSONObject json, Type toType, Map<String,Object> references)
          将json串反序列为对象
protected abstract  E getTarget(JSONMap map, Type toType)
           
protected  Class getTargetType(Type toType, JSONMap map)
          根据JSONMap在#class属性或者 Decoder传进来的class创建对象实例
如果实例被标记了ReferenceID,往references中追加一条记录
protected abstract  void parseFromJSONMap(E target, JSONMap jsonMap, Map<String,Object> references)
          解析jsonMap属性,填充target对象的值
 
从类 org.test4j.json.decoder.base.BaseDecoder 继承的方法
getArgType, getError, getError, getRawType, isInterfaceOrAbstract, newInstance
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
从接口 org.test4j.json.decoder.IDecoder 继承的方法
accept
 

构造方法详细信息

MapPoJoBaseDecoder

public MapPoJoBaseDecoder()
方法详细信息

decode

public final <T> T decode(JSONObject json,
                          Type toType,
                          Map<String,Object> references)
从接口 IDecoder 复制的描述
将json串反序列为对象

返回:

getTarget

protected abstract E getTarget(JSONMap map,
                               Type toType)

getTargetType

protected Class getTargetType(Type toType,
                              JSONMap map)
根据JSONMap在#class属性或者 Decoder传进来的class创建对象实例
如果实例被标记了ReferenceID,往references中追加一条记录

参数:
map -
references -
返回:

parseFromJSONMap

protected abstract void parseFromJSONMap(E target,
                                         JSONMap jsonMap,
                                         Map<String,Object> references)
解析jsonMap属性,填充target对象的值

参数:
target -
jsonMap -
references -


Copyright © 2013. All rights reserved.