class SimpleDateFormatSerializer
        implements ObjectSerializer {
    private final String pattern;

    public SimpleDateFormatSerializer(String pattern) {
        this.pattern = pattern;
    }

    public void write(JSONSerializer serializer,
                      Object object,
                      Object fieldName,
                      Type fieldType,
                      int features) throws IOException {<FILL_FUNCTION_BODY>}
}

        if (object == null) {
            serializer.out.writeNull();
            return;
        }

        Date date = (Date) object;
        SimpleDateFormat format = new SimpleDateFormat(pattern);
        String text = format.format(date);
        serializer.write(text);
    
<no_super_class>