Java Code Examples for org.springframework.util.StringUtils#parseLocale()

The following examples show how to use org.springframework.util.StringUtils#parseLocale() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
@Override
@Nullable
public Locale convert(String source) {
	return StringUtils.parseLocale(source);
}
 
Example 2
@Override
@Nullable
public Locale convert(String source) {
	return StringUtils.parseLocale(source);
}
 
Example 3
Source Project: sdn-rx   File: AdditionalTypes.java    License: Apache License 2.0 2 votes vote down vote up
static Locale asLocale(Value value) {

		return StringUtils.parseLocale(value.asString());
	}
 
Example 4
/**
 * Parse the given locale value coming from an incoming cookie.
 * <p>The default implementation calls {@link StringUtils#parseLocale(String)},
 * accepting the {@link Locale#toString} format as well as BCP 47 language tags.
 * @param localeValue the locale value to parse
 * @return the corresponding {@code Locale} instance
 * @since 4.3
 * @see StringUtils#parseLocale(String)
 */
@Nullable
protected Locale parseLocaleValue(String localeValue) {
	return StringUtils.parseLocale(localeValue);
}
 
Example 5
/**
 * Parse the given locale value as coming from a request parameter.
 * <p>The default implementation calls {@link StringUtils#parseLocale(String)},
 * accepting the {@link Locale#toString} format as well as BCP 47 language tags.
 * @param localeValue the locale value to parse
 * @return the corresponding {@code Locale} instance
 * @since 4.3
 */
@Nullable
protected Locale parseLocaleValue(String localeValue) {
	return StringUtils.parseLocale(localeValue);
}
 
Example 6
/**
 * 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
 */
public Jackson2ObjectMapperBuilder locale(String localeString) {
	this.locale = StringUtils.parseLocale(localeString);
	return this;
}
 
Example 7
/**
 * Parse the given locale value coming from an incoming cookie.
 * <p>The default implementation calls {@link StringUtils#parseLocale(String)},
 * accepting the {@link Locale#toString} format as well as BCP 47 language tags.
 * @param localeValue the locale value to parse
 * @return the corresponding {@code Locale} instance
 * @since 4.3
 * @see StringUtils#parseLocale(String)
 */
@Nullable
protected Locale parseLocaleValue(String localeValue) {
	return StringUtils.parseLocale(localeValue);
}
 
Example 8
/**
 * Parse the given locale value as coming from a request parameter.
 * <p>The default implementation calls {@link StringUtils#parseLocale(String)},
 * accepting the {@link Locale#toString} format as well as BCP 47 language tags.
 * @param localeValue the locale value to parse
 * @return the corresponding {@code Locale} instance
 * @since 4.3
 */
@Nullable
protected Locale parseLocaleValue(String localeValue) {
	return StringUtils.parseLocale(localeValue);
}
 
Example 9
/**
 * 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
 */
public Jackson2ObjectMapperBuilder locale(String localeString) {
	this.locale = StringUtils.parseLocale(localeString);
	return this;
}