Polishing

This commit is contained in:
Juergen Hoeller
2019-09-25 12:14:48 +02:00
parent 0519a2ff3c
commit bb6f9bb6d4
12 changed files with 33 additions and 35 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -41,7 +41,7 @@ public class SseEmitter extends ResponseBodyEmitter {
static final MediaType TEXT_PLAIN = new MediaType("text", "plain", StandardCharsets.UTF_8);
static final MediaType UTF8_TEXT_EVENTSTREAM = new MediaType("text", "event-stream", StandardCharsets.UTF_8);
static final MediaType TEXT_EVENTSTREAM = new MediaType("text", "event-stream", StandardCharsets.UTF_8);
/**
@@ -70,7 +70,7 @@ public class SseEmitter extends ResponseBodyEmitter {
HttpHeaders headers = outputMessage.getHeaders();
if (headers.getContentType() == null) {
headers.setContentType(UTF8_TEXT_EVENTSTREAM);
headers.setContentType(TEXT_EVENTSTREAM);
}
}
@@ -82,10 +82,8 @@ public class SseEmitter extends ResponseBodyEmitter {
* SseEmitter emitter = new SseEmitter();
* emitter.send(event().data(myObject));
* </pre>
*
* <p>Please, see {@link ResponseBodyEmitter#send(Object) parent Javadoc}
* for important notes on exception handling.
*
* @param object the object to write
* @throws IOException raised when an I/O error occurs
* @throws java.lang.IllegalStateException wraps any other errors
@@ -103,10 +101,8 @@ public class SseEmitter extends ResponseBodyEmitter {
* SseEmitter emitter = new SseEmitter();
* emitter.send(event().data(myObject, MediaType.APPLICATION_JSON));
* </pre>
*
* <p>Please, see {@link ResponseBodyEmitter#send(Object) parent Javadoc}
* for important notes on exception handling.
*
* @param object the object to write
* @param mediaType a MediaType hint for selecting an HttpMessageConverter
* @throws IOException raised when an I/O error occurs