org.springframework.beans.propertyeditors
public class: LocaleEditor [javadoc |
source]
java.lang.Object
java.beans.PropertyEditorSupport
org.springframework.beans.propertyeditors.LocaleEditor
All Implemented Interfaces:
PropertyEditor
Editor for
java.util.Locale, to directly populate a Locale property.
Expects the same syntax as Locale's toString, i.e. language +
optionally country + optionally variant, separated by "_" (e.g. "en", "en_US").
Also accepts spaces as separators, as alternative to underscores.
Also see:
- java.util.Locale
- org.springframework.util.StringUtils#parseLocaleString
- author:
Juergen - Hoeller
- since:
26.05.2003 -
| Method from org.springframework.beans.propertyeditors.LocaleEditor Summary: |
|---|
|
getAsText, setAsText |
| Methods from java.beans.PropertyEditorSupport: |
|---|
|
addPropertyChangeListener, firePropertyChange, getAsText, getCustomEditor, getJavaInitializationString, getSource, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setAsText, setSource, setValue, supportsCustomEditor |
| Method from org.springframework.beans.propertyeditors.LocaleEditor Detail: |
public String getAsText() {
Object value = getValue();
return (value != null ? value.toString() : "");
}
|
public void setAsText(String text) {
setValue(StringUtils.parseLocaleString(text));
}
|