package com.alibaba.fastjson.parser.deserializer;

import java.lang.reflect.Type;

import com.alibaba.fastjson.parser.DefaultJSONParser;
import com.alibaba.fastjson.parser.ParserConfig;

/**
 * <p>Interface representing a custom deserializer for Json. You should write a custom
 * deserializer, if you are not happy with the default deserialization done by Gson. You will
 * also need to register this deserializer through
 * {@link ParserConfig#putDeserializer(Type, ObjectDeserializer)}.</p>
 * <pre>
 * public static enum OrderActionEnum {
 *     FAIL(1), SUCC(0);
 * 
 *     private int code;
 * 
 *     OrderActionEnum(int code){
 *         this.code = code;
 *     }
 * }
 * 
 * public static class OrderActionEnumDeser implements ObjectDeserializer {
 *     
 *     public &lt;T&gt; T deserialze(DefaultJSONParser parser, Type type, Object fieldName) {
 *         Integer intValue = parser.parseObject(int.class);
 *         if (intValue == 1) {
 *             return (T) OrderActionEnum.FAIL;
 *         } else if (intValue == 0) {
 *             return (T) OrderActionEnum.SUCC;
 *         }
 *         throw new IllegalStateException();
 *     }
 * 
 *     
 *     public int getFastMatchToken() {
 *         return JSONToken.LITERAL_INT;
 *     }
 * }
 * </pre>
 * 
 * <p>You will also need to register {@code OrderActionEnumDeser} to ParserConfig:</p>
 * <pre>
 * ParserConfig.getGlobalInstance().putDeserializer(OrderActionEnum.class, new OrderActionEnumDeser());
 * </pre>
 */
public interface ObjectDeserializer {
    <T> T deserialze(DefaultJSONParser parser, Type type, Object fieldName);
    
    int getFastMatchToken();
}

@@ -108,32 +108,110 @@
 son.
-parser.DefaultJSONParser
+JSON;%0Aimport com.alibaba.fastjson.parser.DefaultJSONParser;%0Aimport com.alibaba.fastjson.parser.Feature
 ;%0Aim
@@ -1600,16 +1600,659 @@
 lizer %7B%0A
+    /**%0A     * fastjson invokes this call-back method during deserialization when it encounters a field of the%0A     * specified type.%0A     * %3Cp%3EIn the implementation of this call-back method, you should consider invoking%0A     * %7B@link JSON#parseObject(String, Type, Feature%5B%5D)%7D method to create objects%0A     * for any non-trivial field of the returned object. %0A     *%0A     * @param parser context DefaultJSONParser being deserialized%0A     * @param type The type of the Object to deserialize to%0A     * @param fieldName parent object field name%0A     * @return a deserialized object of the specified type which is a subclass of %7B@code T%7D%0A     */%0A
     %3CT%3E 

add java doc