MappingJackson(2)HttpMessageConverter alignment

This commit is contained in:
Juergen Hoeller
2013-05-07 18:10:17 +02:00
committed by unknown
parent a0c377b91b
commit fcb0cf27d7
4 changed files with 37 additions and 33 deletions

View File

@@ -42,15 +42,14 @@ import org.springframework.web.servlet.view.AbstractView;
* using <a href="http://jackson.codehaus.org/">Jackson 2.x's</a> {@link ObjectMapper}.
*
* <p>By default, the entire contents of the model map (with the exception of framework-specific classes)
* will be encoded as JSON. If the model contains only one key, you can have it extracted encoded as JSON
* alone via {@link #setExtractValueFromSingleKeyModel}.
* will be encoded as JSON. If the model contains only one key, you can have it extracted encoded as
* JSON alone via {@link #setExtractValueFromSingleKeyModel}.
*
* @author Jeremy Grelle
* @author Arjen Poutsma
* @author Rossen Stoyanchev
* @author Juergen Hoeller
* @since 3.1.2
* @see org.springframework.http.converter.json.MappingJackson2HttpMessageConverter
*/
public class MappingJackson2JsonView extends AbstractView {
@@ -280,6 +279,7 @@ public class MappingJackson2JsonView extends AbstractView {
protected void writeContent(OutputStream stream, Object value, boolean prefixJson) throws IOException {
// The following has been deprecated as late as Jackson 2.2 (April 2013);
// preserved for the time being, for Jackson 2.0/2.1 compatibility.
@SuppressWarnings("deprecation")
JsonGenerator generator = this.objectMapper.getJsonFactory().createJsonGenerator(stream, this.encoding);
// A workaround for JsonGenerators not applying serialization features

View File

@@ -42,15 +42,14 @@ import org.springframework.web.servlet.view.AbstractView;
* using <a href="http://jackson.codehaus.org/">Jackson 1.x's</a> {@link ObjectMapper}.
*
* <p>By default, the entire contents of the model map (with the exception of framework-specific classes)
* will be encoded as JSON. If the model contains only one key, you can have it extracted encoded as JSON
* alone via {@link #setExtractValueFromSingleKeyModel}.
* will be encoded as JSON. If the model contains only one key, you can have it extracted encoded as
* JSON alone via {@link #setExtractValueFromSingleKeyModel}.
*
* @author Jeremy Grelle
* @author Arjen Poutsma
* @author Rossen Stoyanchev
* @author Juergen Hoeller
* @since 3.0
* @see org.springframework.http.converter.json.MappingJacksonHttpMessageConverter
*/
public class MappingJacksonJsonView extends AbstractView {