public void writeEnum(Enum e) {
        if (e == null) {
            writeNull();
            return;
        }

        if ((context.features & WriteEnumUsingToString.mask) != 0) {
            writeString(e.toString());
        } else if ((context.features & WriteEnumsUsingName.mask) != 0) {
            writeString(e.name());
        } else {
            writeInt32(e.ordinal());
        }
    }
If ReferenceDetection has been set, returns the path of the current object, otherwise returns null
@since 2.0.51
@return the path of the current object
core/src/main/java/com/alibaba/fastjson2/JSONWriter.java