Search in sources :

Example 1 with ListResolveFieldDeserializer

use of com.alibaba.fastjson.parser.deserializer.ListResolveFieldDeserializer in project uavstack by uavorg.

the class DefaultJSONParser method checkListResolve.

@SuppressWarnings("rawtypes")
public void checkListResolve(Collection array) {
    if (resolveStatus == NeedToResolve) {
        if (array instanceof List) {
            final int index = array.size() - 1;
            final List list = (List) array;
            ResolveTask task = getLastResolveTask();
            task.setFieldDeserializer(new ListResolveFieldDeserializer(this, list, index));
            task.setOwnerContext(context);
            setResolveStatus(DefaultJSONParser.NONE);
        } else {
            ResolveTask task = getLastResolveTask();
            task.setFieldDeserializer(new CollectionResolveFieldDeserializer(this, array));
            task.setOwnerContext(context);
            setResolveStatus(DefaultJSONParser.NONE);
        }
    }
}
Also used : List(java.util.List) ArrayList(java.util.ArrayList) CollectionResolveFieldDeserializer(com.alibaba.fastjson.parser.deserializer.CollectionResolveFieldDeserializer) ListResolveFieldDeserializer(com.alibaba.fastjson.parser.deserializer.ListResolveFieldDeserializer)

Aggregations

CollectionResolveFieldDeserializer (com.alibaba.fastjson.parser.deserializer.CollectionResolveFieldDeserializer)1 ListResolveFieldDeserializer (com.alibaba.fastjson.parser.deserializer.ListResolveFieldDeserializer)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1