class ObjectWriterImplLocalDateTime
        extends DateTimeCodec
        implements ObjectWriter {
    static final ObjectWriterImplLocalDateTime INSTANCE = new ObjectWriterImplLocalDateTime(null, null);

    static ObjectWriterImplLocalDateTime of(String format, Locale locale) {
        return new ObjectWriterImplLocalDateTime(format, locale);
    }

    public ObjectWriterImplLocalDateTime(String format, Locale locale) {
        super(format, locale);
    }

    @Override
    public void writeJSONB(JSONWriter jsonWriter, Object object, Object fieldName, Type fieldType, long features) {<FILL_FUNCTION_BODY>}

    @Override
    public void write(JSONWriter jsonWriter, Object object, Object fieldName, Type fieldType, long features) {
        if (object == null) {
            jsonWriter.writeNull();
            return;
        }

        JSONWriter.Context ctx = jsonWriter.context;

        LocalDateTime ldt = (LocalDateTime) object;

        if (formatUnixTime || (format == null && ctx.isDateFormatUnixTime())) {
            long millis = ldt.atZone(ctx.getZoneId())
                    .toInstant()
                    .toEpochMilli();
            jsonWriter.writeInt64(millis / 1000);
            return;
        }

        if (formatMillis || (format == null && ctx.isDateFormatMillis())) {
            long millis = ldt.atZone(ctx.getZoneId())
                    .toInstant()
                    .toEpochMilli();
            jsonWriter.writeInt64(millis);
            return;
        }

        int year = ldt.getYear();
        if (year >= 0 && year <= 9999) {
            if (formatISO8601 || (format == null && ctx.isDateFormatISO8601())) {
                int month = ldt.getMonthValue();
                int dayOfMonth = ldt.getDayOfMonth();
                int hour = ldt.getHour();
                int minute = ldt.getMinute();
                int second = ldt.getSecond();
                int nano = ldt.getNano() / 1000_000;
                int offsetSeconds = ctx.getZoneId().getRules().getOffset(ldt).getTotalSeconds();
                jsonWriter.writeDateTimeISO8601(year, month, dayOfMonth, hour, minute, second, nano, offsetSeconds, true);
                return;
            }

            if (yyyyMMddhhmmss19) {
                jsonWriter.writeDateTime19(
                        year,
                        ldt.getMonthValue(),
                        ldt.getDayOfMonth(),
                        ldt.getHour(),
                        ldt.getMinute(),
                        ldt.getSecond()
                );
                return;
            }

            if (yyyyMMddhhmmss14) {
                jsonWriter.writeDateTime14(
                        year,
                        ldt.getMonthValue(),
                        ldt.getDayOfMonth(),
                        ldt.getHour(),
                        ldt.getMinute(),
                        ldt.getSecond()
                );
                return;
            }

            if (yyyyMMdd8) {
                jsonWriter.writeDateYYYMMDD8(
                        year,
                        ldt.getMonthValue(),
                        ldt.getDayOfMonth());
                return;
            }

            if (yyyyMMdd10) {
                jsonWriter.writeDateYYYMMDD10(
                        year,
                        ldt.getMonthValue(),
                        ldt.getDayOfMonth());
                return;
            }
        }

        DateTimeFormatter formatter = this.getDateFormatter();
        if (formatter == null) {
            formatter = ctx.getDateFormatter();
        }

        if (formatter == null) {
            jsonWriter.writeLocalDateTime(ldt);
            return;
        }

        String str;
        if (useSimpleDateFormat) {
            Instant instant = ldt.toInstant(jsonWriter.context.getZoneId().getRules().getOffset(ldt));
            Date date = new Date(instant.toEpochMilli());
            str = new SimpleDateFormat(this.format).format(date);
        } else {
            if (locale != null) {
                ZonedDateTime zdt = ZonedDateTime.of(ldt, jsonWriter.context.getZoneId());
                str = formatter.format(zdt);
            } else {
                str = formatter.format(ldt);
            }
        }
        jsonWriter.writeString(str);
    }
}

        if (format != null) {
            write(jsonWriter, object, fieldName, fieldType, features);
            return;
        }
        jsonWriter.writeLocalDateTime((LocalDateTime) object);
    
<methods>public void <init>(java.lang.String) ,public void <init>(java.lang.String, java.util.Locale) ,public java.time.format.DateTimeFormatter getDateFormatter() ,public java.time.format.DateTimeFormatter getDateFormatter(java.util.Locale) <variables>java.time.format.DateTimeFormatter dateFormatter,public final non-sealed java.lang.String format,protected final non-sealed boolean formatHasDay,protected final non-sealed boolean formatHasHour,public final non-sealed boolean formatISO8601,public final non-sealed boolean formatMillis,public final non-sealed boolean formatUnixTime,public final non-sealed java.util.Locale locale,protected final non-sealed boolean useSimpleDateFormat,public final non-sealed boolean useSimpleFormatter,protected final non-sealed boolean yyyyMMdd10,protected final non-sealed boolean yyyyMMdd8,protected final non-sealed boolean yyyyMMddhhmm16,protected final non-sealed boolean yyyyMMddhhmmss14,protected final non-sealed boolean yyyyMMddhhmmss19