code: private void writeField(String fieldName, DataType fieldType, Object value) throws IOException
     {
        switch (fieldType)
        {
           case INTEGER:
           {
              writeIntegerField(fieldName, value);
              break;
           }
  
           case PERCENTAGE:
           case CURRENCY:
           case NUMERIC:
           case UNITS:
           {
              writeDoubleField(fieldName, value);
              break;
           }
  
           case BOOLEAN:
           {
              writeBooleanField(fieldName, value);
              break;
           }
  
           case WORK:
           case DURATION:
           {
              writeDurationField(fieldName, value);
              break;
           }
  
           case DATE:
           {
              writeDateField(fieldName, value);
              break;
           }
  
           case TIME_UNITS:
           {
              writeTimeUnitsField(fieldName, value);
              break;
           }
  
           case PRIORITY:
           {
              writePriorityField(fieldName, value);
              break;
           }
  
           case RELATION_LIST:
           {
              writeRelationList(fieldName, value);
              break;
           }
  
           case MAP:
           {
              writeMap(fieldName, value);
              break;
           }
  
           case BINARY:
           {
              // Don't write binary data
              break;
           }
  
           default:
           {
              writeStringField(fieldName, value);
              break;
           }
        }
     }
docs: Write the appropriate data for a field to the JSON file based on its type.
  
  @param fieldName field name
  @param fieldType field type
  @param value field value