Commit 92871ea0 authored by Stephane Nicoll's avatar Stephane Nicoll

Polish

See gh-3600
parent 64461bb9
...@@ -20,6 +20,7 @@ import java.lang.reflect.Field; ...@@ -20,6 +20,7 @@ import java.lang.reflect.Field;
import java.text.DateFormat; import java.text.DateFormat;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Collection; import java.util.Collection;
import java.util.Locale;
import java.util.Map; import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
...@@ -64,6 +65,7 @@ import com.fasterxml.jackson.datatype.joda.ser.DateTimeSerializer; ...@@ -64,6 +65,7 @@ import com.fasterxml.jackson.datatype.joda.ser.DateTimeSerializer;
* @author Andy Wilkinson * @author Andy Wilkinson
* @author Marcel Overdijk * @author Marcel Overdijk
* @author Sebastien Deleuze * @author Sebastien Deleuze
* @author Johannes Stelzer
* @since 1.1.0 * @since 1.1.0
*/ */
@Configuration @Configuration
...@@ -239,7 +241,7 @@ public class JacksonAutoConfiguration { ...@@ -239,7 +241,7 @@ public class JacksonAutoConfiguration {
} }
private void configureLocale(Jackson2ObjectMapperBuilder builder) { private void configureLocale(Jackson2ObjectMapperBuilder builder) {
String locale = this.jacksonProperties.getLocale(); Locale locale = this.jacksonProperties.getLocale();
if (locale != null) { if (locale != null) {
builder.locale(locale); builder.locale(locale);
} }
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
package org.springframework.boot.autoconfigure.jackson; package org.springframework.boot.autoconfigure.jackson;
import java.util.HashMap; import java.util.HashMap;
import java.util.Locale;
import java.util.Map; import java.util.Map;
import java.util.TimeZone; import java.util.TimeZone;
...@@ -34,6 +35,7 @@ import com.fasterxml.jackson.databind.SerializationFeature; ...@@ -34,6 +35,7 @@ import com.fasterxml.jackson.databind.SerializationFeature;
* *
* @author Andy Wilkinson * @author Andy Wilkinson
* @author Marcel Overdijk * @author Marcel Overdijk
* @author Johannes Stelzer
* @since 1.2.0 * @since 1.2.0
*/ */
@ConfigurationProperties(prefix = "spring.jackson") @ConfigurationProperties(prefix = "spring.jackson")
...@@ -98,7 +100,7 @@ public class JacksonProperties { ...@@ -98,7 +100,7 @@ public class JacksonProperties {
/** /**
* Locale used for formatting. * Locale used for formatting.
*/ */
private String locale; private Locale locale;
public String getDateFormat() { public String getDateFormat() {
return this.dateFormat; return this.dateFormat;
...@@ -160,11 +162,11 @@ public class JacksonProperties { ...@@ -160,11 +162,11 @@ public class JacksonProperties {
this.timeZone = timeZone; this.timeZone = timeZone;
} }
public String getLocale() { public Locale getLocale() {
return this.locale; return this.locale;
} }
public void setLocale(String locale) { public void setLocale(Locale locale) {
this.locale = locale; this.locale = locale;
} }
......
...@@ -72,6 +72,7 @@ import static org.mockito.Mockito.mock; ...@@ -72,6 +72,7 @@ import static org.mockito.Mockito.mock;
* @author Andy Wilkinson * @author Andy Wilkinson
* @author Marcel Overdijk * @author Marcel Overdijk
* @author Sebastien Deleuze * @author Sebastien Deleuze
* @author Johannes Stelzer
*/ */
public class JacksonAutoConfigurationTests { public class JacksonAutoConfigurationTests {
......
...@@ -176,6 +176,7 @@ content into your application; rather pick only the properties that you need. ...@@ -176,6 +176,7 @@ content into your application; rather pick only the properties that you need.
spring.jackson.deserialization.*= # see Jackson's DeserializationFeature spring.jackson.deserialization.*= # see Jackson's DeserializationFeature
spring.jackson.generator.*= # see Jackson's JsonGenerator.Feature spring.jackson.generator.*= # see Jackson's JsonGenerator.Feature
spring.jackson.joda-date-time-format= # Joda date time format string spring.jackson.joda-date-time-format= # Joda date time format string
spring.jackson.locale= # locale used for formatting
spring.jackson.mapper.*= # see Jackson's MapperFeature spring.jackson.mapper.*= # see Jackson's MapperFeature
spring.jackson.parser.*= # see Jackson's JsonParser.Feature spring.jackson.parser.*= # see Jackson's JsonParser.Feature
spring.jackson.serialization.*= # see Jackson's SerializationFeature spring.jackson.serialization.*= # see Jackson's SerializationFeature
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment