code: private void writeAttribute(Writer writer, String name, String value, int depth, boolean compact)
      throws IOException
      {
          if (logger.isLoggable(Level.FINER)) logger.entering(className, "writeAttribute(Writer, String, String, int)");
  
          if (!compact)
          {
              writeIndention(writer, depth);
          }
  
          try
          {
              if (!compact)
              {
                  writer.write("\"" + name + "\"" + " : " + "\"" + escapeStringSpecialCharacters(value) + "\"");
              }
              else
              {
                  writer.write("\"" + name + "\"" + ":" + "\"" + escapeStringSpecialCharacters(value) + "\"");
              }
          }
          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, "writeAttribute(Writer, String, String, int)");
      }
docs: Internal method to write out a proper JSON attribute string.
  @param writer The writer to use while serializing
  @param name The attribute name to use.
  @param value The value to assign to the attribute.
  @param depth How far to indent the JSON text.
  @param compact Flag to denote whether or not to use pretty indention, or compact format, when writing.
  @throws IOException Trhown if an error occurs on write.