package com.alibaba.fastjson.serializer;

public class SerialContext {

    public final SerialContext parent;
    public final Object        object;
    public final Object        fieldName;
    public final int           features;

    public SerialContext(SerialContext parent, Object object, Object fieldName, int features, int fieldFeatures){
        this.parent = parent;
        this.object = object;
        this.fieldName = fieldName;
        this.features = features;
    }

    public String toString() {
        if (parent == null) {
            return "$";
        } else {
            if (fieldName instanceof Integer) {
                return parent.toString() + "[" + fieldName + "]";
            } else {
                return parent.toString() + "." + fieldName;
            }

        }
    }
}

@@ -805,11 +805,414 @@
  %7D%0A    %7D
+%0A%0A    /**%0A     * @deprecated%0A     */%0A    public SerialContext getParent() %7B%0A        return parent;%0A    %7D%0A%0A    /**%0A     * @deprecated%0A     */%0A    public Object getObject() %7B%0A        return object;%0A    %7D%0A%0A    /**%0A     * @deprecated%0A     */%0A    public Object getFieldName() %7B%0A        return fieldName;%0A    %7D%0A%0A    /**%0A     * @deprecated%0A     */%0A    public String getPath() %7B%0A        return toString();%0A    %7D
 %0A%7D%0A

add deprecated method for compatible