public class FormattedNumberConverter extends BaseConverter implements StateHolder
Modifier and Type | Field and Description |
---|---|
static String |
CONVERTER_ID |
protected NumberFormat |
m_DecFormat |
protected String |
m_sPattern |
BAD_PARAMETER_LONG_ID, BAD_PARAMETER_SHORT_ID, BAD_STRING_LONG_ID, BAD_STRING_SHORT_ID, BAD_TYPE_LONG_ID, BAD_TYPE_SHORT_ID, m_bshowCAFErrorMsg, m_clientLocale, m_CustomMessage
DATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE_PARAM_NAME
Constructor and Description |
---|
FormattedNumberConverter() |
Modifier and Type | Method and Description |
---|---|
Object |
getAsObject(FacesContext context,
UIComponent component,
String value) |
String |
getAsString(FacesContext context,
UIComponent component,
Object value) |
String |
getAsString(Object value,
Class<?> classType,
FacesContext context) |
Number |
getNumber(String value,
Class<?> classType,
FacesContext context) |
protected NumberFormat |
getNumberFormater(FacesContext context) |
String |
getPattern() |
String |
getRegion()
getRegion Set the locale for the validated to use.
|
boolean |
isTransient() |
void |
restoreState(FacesContext context,
Object state) |
Object |
saveState(FacesContext context) |
void |
setPattern(String sPattern) |
void |
setRegion(String region)
setRegion Set the locale for the validated to use.
|
void |
setTransient(boolean bValue) |
getBadCommonInputMsg, getBadInputMsg, getBadInputMsg, getBadInputStringTypeMsg, getBadInputTypeMsg, getClientLocale, getClientTimeZone, getCustomErrorMsg, getshowCAFErrorMsg, isBlankValue, isStringObj, isValue, setCustomErrorMsg, setshowCAFErrorMsg, validateFromObject, validateFromString
public static final String CONVERTER_ID
protected String m_sPattern
protected NumberFormat m_DecFormat
public Object getAsObject(FacesContext context, UIComponent component, String value)
getAsObject
in interface Converter
public Number getNumber(String value, Class<?> classType, FacesContext context)
public String getAsString(FacesContext context, UIComponent component, Object value)
getAsString
in interface Converter
public String getAsString(Object value, Class<?> classType, FacesContext context)
public void setPattern(String sPattern)
public String getPattern()
public void setRegion(String region)
BaseConverter
setRegion
in class BaseConverter
region
- the local object to use. Null will make the
locale use the session's locale.public String getRegion()
BaseConverter
getRegion
in class BaseConverter
public Object saveState(FacesContext context)
saveState
in interface StateHolder
public void restoreState(FacesContext context, Object state)
restoreState
in interface StateHolder
public void setTransient(boolean bValue)
setTransient
in interface StateHolder
public boolean isTransient()
isTransient
in interface StateHolder
protected NumberFormat getNumberFormater(FacesContext context)