com.taco.text
Class StringToLocaleConverter

java.lang.Object
  extended by com.taco.text.AbstractStringToObjectConverter
      extended by com.taco.text.StringToLocaleConverter
All Implemented Interfaces:
IStringToObjectConverter, IObjectMapper, java.io.Serializable

public final class StringToLocaleConverter
extends AbstractStringToObjectConverter
implements java.io.Serializable

A converter from strings to instances of Locale.

See Also:
Serialized Form

Field Summary
static StringToLocaleConverter instance
          The singleton instance of this class.
static java.util.regex.Pattern LOCALE_PATTERN
          The regex pattern compiled from LOCALE_REGEX_STRING.
static java.lang.String LOCALE_REGEX_STRING
          A regex string for a locale.
 
Method Summary
 java.lang.Object toObject(java.lang.String s)
           
 
Methods inherited from class com.taco.text.AbstractStringToObjectConverter
map
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOCALE_REGEX_STRING

public static java.lang.String LOCALE_REGEX_STRING
A regex string for a locale. The language, country, and variant are captured in groups 1 - 3. The country and/or variant may be null.


LOCALE_PATTERN

public static java.util.regex.Pattern LOCALE_PATTERN
The regex pattern compiled from LOCALE_REGEX_STRING.


instance

public static final StringToLocaleConverter instance
The singleton instance of this class.

Method Detail

toObject

public java.lang.Object toObject(java.lang.String s)
                          throws java.text.ParseException
Specified by:
toObject in interface IStringToObjectConverter
Throws:
java.text.ParseException