@@ -0,0 +1,1444 @@
+package com.dongdongxia.myfastjson.serializer;%0A/**%0A * %0A * %3CP%3EDescription: JSON%E5%89%8D%E7%BD%AE%E8%BF%87%E6%BB%A4%E5%99%A8%3C/P%3E%0A * @ClassName: BeforeFilter%0A * @author java_liudong@163.com  2017%E5%B9%B44%E6%9C%8828%E6%97%A5 %E4%B8%8B%E5%8D%882:12:21%0A */%0Apublic abstract class BeforeFilter implements SerializeFilter%7B%0A%09%0A%09private static final ThreadLocal%3CJSONSerializer%3E serializerLocal = new ThreadLocal%3CJSONSerializer%3E();%0A%09// %E5%88%86%E7%A6%BB%E5%99%A8 : seperator%0A%09private static final ThreadLocal%3CCharacter%3E seperatorLocal = new ThreadLocal%3CCharacter%3E();%0A%09%0A%09private final static Character COMMA = Character.valueOf(',');%0A%09%0A%09/**%0A%09 * %0A%09 * %3Cp%3ETitle: writeBefore%3C/p%3E%0A%09 * %3Cp%3EDescription: %E5%86%99%E5%85%A5%E7%9A%84%E6%96%B9%E6%B3%95%3C/p%3E%0A%09 * @param serializer%0A%09 * @param object%0A%09 * @param seperator%0A%09 * @return%0A%09 * @author java_liudong@163.com  2017%E5%B9%B44%E6%9C%8828%E6%97%A5 %E4%B8%8B%E5%8D%882:22:24%0A%09 */%0A%09final char writeBefore(JSONSerializer serializer, Object object, char seperator) %7B%0A%09%09serializerLocal.set(serializer);%0A%09%09seperatorLocal.set(seperator);%0A%09%09writeBefore(object);%0A%09%09serializerLocal.set(null);%0A%09%09return seperatorLocal.get();%0A%09%7D%0A%09%0A%09%0A%09protected final void writeKeyValue(String key, Object value) %7B%0A%09%09JSONSerializer serializer = serializerLocal.get();%0A%09%09char seperator = seperatorLocal.get();%0A%09%09serializer.writeKeyValue(seperator, key, value);%0A%09%09if (seperator != ',') %7B%0A%09%09%09seperatorLocal.set(COMMA);%0A%09%09%7D%0A%09%7D%0A%0A%09/**%0A%09 * %0A%09 * %3Cp%3ETitle: writeBefore%3C/p%3E%0A%09 * %3Cp%3EDescription: %E5%AD%90%E7%B1%BB%E5%AE%9E%E7%8E%B0%E5%86%99%E5%85%A5%E7%9A%84%E6%96%B9%E6%B3%95%3C/p%3E%0A%09 * @param object%0A%09 * @author java_liudong@163.com  2017%E5%B9%B44%E6%9C%8828%E6%97%A5 %E4%B8%8B%E5%8D%882:21:49%0A%09 */%0A%09public abstract void writeBefore(Object object);%0A%7D%0A

添加 : 序列化的前置处理器