docs: private void writeChildren(Writer writer, int depth, boolean compact)
      throws IOException
      {
          if (logger.isLoggable(Level.FINER)) logger.entering(className, "writeChildren(Writer, int, boolean)");
  
          if (!jsonObjects.isEmpty())
          {
              Enumeration keys = jsonObjects.keys();
              while (keys.hasMoreElements())
              {
                  String objName = (String)keys.nextElement();
                  Vector vect = (Vector)jsonObjects.get(objName);
                  if (vect != null && !vect.isEmpty())
                  {
                      /**
                       * Non-array versus array elements.
                       */
                      if (vect.size() == 1)
                      {
                          if (logger.isLoggable(Level.FINEST)) logger.logp(Level.FINEST, className, "writeChildren(Writer, int, boolean)", "Writing child object: [" + objName + "]");
  
                          JSONObject obj = (JSONObject)vect.elementAt(0);
                          obj.writeObject(writer,depth + 1, false, compact);
                          if (keys.hasMoreElements())
                          {
                              try
                              {
                                  if (!compact)
                                  {
                                      if (!obj.isTextOnlyObject() && !obj.isEmptyObject())
                                      {
                                          writeIndention(writer,depth + 1);
                                      }
                                      writer.write(",\n");
                                  }
                                  else
                                  {
                                      writer.write(",");
                                  }
                              }
                              catch (Exception ex)
                              {
                                  IOException iox = new IOException("Error occurred on serialization of JSON text.");
                                  iox.initCause(ex);
                                  throw iox;
                              }
                          }
                          else
                          {
                              if (obj.isTextOnlyObject() && !compact)
                              {
                                  writer.write("\n");
                              }
                          }
                      }
                      else
                      {
                          if (logger.isLoggable(Level.FINEST)) logger.logp(Level.FINEST, className, "writeChildren(Writer, int, boolean)", "Writing array of JSON objects with attribute name: [" + objName + "]");
  
                          try
                          {
                              if (!compact)
                              {
                                  writeIndention(writer,depth + 1);
                                  writer.write("\"" + objName + "\"");
                                  writer.write(" : [\n");
                              }
                              else
                              {
                                  writer.write("\"" + objName + "\"");
                                  writer.write(":[");
                              }
                              for (int i = 0; i < vect.size(); i++)
                              {
                                  JSONObject obj = (JSONObject)vect.elementAt(i);
                                  obj.writeObject(writer,depth + 2, true, compact);
  
                                  /**
                                   * Still more we haven't handled.
                                   */
                                  if (i != (vect.size() -1) )
                                  {
                                      if (!compact)
                                      {
                                          if (!obj.isTextOnlyObject() && !obj.isEmptyObject())
                                          {
                                              writeIndention(writer,depth + 2);
                                          }
                                          writer.write(",\n");
                                      }
                                      else
                                      {
                                          writer.write(",");
                                      }
                                  }
                              }
  
                              if (!compact)
                              {
                                  writer.write("\n");
                                  writeIndention(writer,depth + 1);
                              }
  
                              writer.write("]");
                              if (keys.hasMoreElements())
                              {
                                  writer.write(",");
                              }
  
                              if (!compact)
                              {
                                  writer.write("\n");
                              }
                          }
                          catch (Exception ex)
                          {
                              IOException iox = new IOException("Error occurred on serialization of JSON text.");
                              iox.initCause(ex);
                              throw iox;
                          }
                      }
                  }
              }
          }
  
          if (logger.isLoggable(Level.FINER)) logger.exiting(className, "writeChildren(Writer, int, boolean)");
      }