Top Description Fields Constructors Methods
org.jboss.logging

pack-priv Class LoggingLocale

extends Object
Class Inheritance
Annotations
@SuppressWarnings:SameParameterValue
Imports
java.util.Locale

A simple utility to resolve the default locale to use for internationalized loggers and message bundles.
Author
James R. Perkins

Field Summary

Modifier and TypeField and Description
private static final Locale

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private static Locale
forLanguageTag(final String locale)

private static Locale
pack-priv static Locale

Returns:

the locale created or the default locale
getLocale
()

Attempts to create a Locale based on the org.jboss.logging.locale system property.

private static boolean
isAlpha(final String value, final int minLen, final int maxLen)

private static boolean
isAlphaOrNumeric(final String value, final int minLen, final int maxLen)

private static boolean
isNumeric(final String value, final int minLen, final int maxLen)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

LOCALEback to summary
private static final Locale LOCALE

Constructor Detail

LoggingLocaleback to summary
pack-priv LoggingLocale()

Method Detail

forLanguageTagback to summary
private static Locale forLanguageTag(final String locale)
getDefaultLocaleback to summary
private static Locale getDefaultLocale()
getLocaleback to summary
pack-priv static Locale getLocale()

Attempts to create a Locale based on the org.jboss.logging.locale system property. If the value is not defined the default locale will be used.

The value should be in the BCP 47 format.

Note

Currently this uses a custom parser to attempt to parse the BCP 47 format. This will be changed to use the Locale.forLanguageTag() once a move to JDK 7. Currently only the language, region and variant are used to construct the locale.

Returns:Locale

the locale created or the default locale

isAlphaback to summary
private static boolean isAlpha(final String value, final int minLen, final int maxLen)
isAlphaOrNumericback to summary
private static boolean isAlphaOrNumeric(final String value, final int minLen, final int maxLen)
isNumericback to summary
private static boolean isNumeric(final String value, final int minLen, final int maxLen)