Example usage for org.springframework.util StringUtils parseLocale

List of usage examples for org.springframework.util StringUtils parseLocale

Introduction

In this page you can find the example usage for org.springframework.util StringUtils parseLocale.

Prototype

@Nullable
public static Locale parseLocale(String localeValue) 

Source Link

Document

Parse the given String value into a Locale , accepting the Locale#toString format as well as BCP 47 language tags.

Usage

From source file:org.springframework.http.converter.json.Jackson2ObjectMapperBuilder.java

/**
 * Override the default {@link Locale} to use for formatting.
 * Default value used is {@link Locale#getDefault()}.
 * @param localeString the locale ID as a String representation
 * @since 4.1.5/*w w  w  .j  av  a 2  s .c  om*/
 */
public Jackson2ObjectMapperBuilder locale(String localeString) {
    this.locale = StringUtils.parseLocale(localeString);
    return this;
}