org.test4j.json.encoder
类 PropertyEncoder

java.lang.Object
  继承者 org.test4j.json.encoder.JSONEncoder<Object>
      继承者 org.test4j.json.encoder.PropertyEncoder

public abstract class PropertyEncoder
extends JSONEncoder<Object>


字段摘要
 
从类 org.test4j.json.encoder.JSONEncoder 继承的字段
clazz, features, ignoreExplicitFieldType, quote_Char, skipNullField, unMarkClassFlag
 
构造方法摘要
protected PropertyEncoder(int features)
           
 
方法摘要
abstract  boolean doesSkipNull()
           
 boolean encode(Object target, Writer writer, List<String> references)
          将java对象序列化为json字符串
protected abstract  void encodeKey(Writer writer, List<String> references)
          编码对象字段名称或者 Key-Value 的key值
protected abstract  void encodeValue(Writer writer, List<String> references)
          编码对象字段值或者 Key-Value 的value值
static PropertyEncoder newInstance(Field field, Object target, int features)
           
static PropertyEncoder newInstance(Object key, Object value, int features)
           
 
从类 org.test4j.json.encoder.JSONEncoder 继承的方法
get, setFeatures, setFeatures, setUnMarkClassFlag, wrapException, writeClassFlag, writerNullOrReference, writerSpecProperty
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

PropertyEncoder

protected PropertyEncoder(int features)
方法详细信息

encodeKey

protected abstract void encodeKey(Writer writer,
                                  List<String> references)
                           throws Exception
编码对象字段名称或者 Key-Value 的key值

参数:
owner - 字段的所有者,或者K-V所有者Map
writer -
references -
抛出:
Exception

encodeValue

protected abstract void encodeValue(Writer writer,
                                    List<String> references)
                             throws Exception
编码对象字段值或者 Key-Value 的value值

参数:
owner - 字段的所有者,或者K-V所有者Map
writer -
references -
抛出:
Exception

encode

public final boolean encode(Object target,
                            Writer writer,
                            List<String> references)
将java对象序列化为json字符串

target 是属性的owner对象

指定者:
JSONEncoder<Object> 中的 encode
writer - 序列化字符串输出器
返回:
TODO

newInstance

public static PropertyEncoder newInstance(Field field,
                                          Object target,
                                          int features)

newInstance

public static PropertyEncoder newInstance(Object key,
                                          Object value,
                                          int features)

doesSkipNull

public abstract boolean doesSkipNull()


Copyright © 2013. All rights reserved.