Package jakarta.faces.convert
Class NumberConverter
- java.lang.Object
- 
- jakarta.faces.convert.NumberConverter
 
- 
- All Implemented Interfaces:
- PartialStateHolder,- StateHolder,- Converter
 
 @JSFConverter(name="f:convertNumber", bodyContent="empty") @JSFJspProperty(name="binding", returnType="jakarta.faces.convert.NumberConverter", longDesc="A ValueExpression that evaluates to a NumberConverter.") public class NumberConverter extends Object implements Converter, PartialStateHolderThis tag creates a number formatting converter and associates it with the nearest parent UIComponent. Unless otherwise specified, all attributes accept static values or EL expressions. see Javadoc of JSF Specification
- 
- 
Field SummaryFields Modifier and Type Field Description static StringCONVERTER_IDstatic StringCURRENCY_IDstatic StringNUMBER_IDstatic StringPATTERN_IDstatic StringPERCENT_IDstatic StringSTRING_ID- 
Fields inherited from interface jakarta.faces.convert.ConverterDATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE_PARAM_NAME
 
- 
 - 
Constructor SummaryConstructors Constructor Description NumberConverter()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearInitialState()ObjectgetAsObject(FacesContext facesContext, UIComponent uiComponent, String value)StringgetAsString(FacesContext facesContext, UIComponent uiComponent, Object value)StringgetCurrencyCode()ISO 4217 currency codeStringgetCurrencySymbol()The currency symbol used to format a currency value.LocalegetLocale()The name of the locale to be used, instead of the default as specified in the faces configuration file.intgetMaxFractionDigits()The maximum number of digits in the fractional portion of the number.intgetMaxIntegerDigits()The maximum number of digits in the integer portion of the number.intgetMinFractionDigits()The minimum number of digits in the fractional portion of the number.intgetMinIntegerDigits()The minimum number of digits in the integer portion of the number.StringgetPattern()A custom Date formatting pattern, in the format used by java.text.SimpleDateFormat.StringgetType()The type of formatting/parsing to be performed.booleaninitialStateMarked()booleanisGroupingUsed()Specifies whether output will contain grouping separators.booleanisIntegerOnly()Specifies whether only the integer part of the input will be parsed.booleanisTransient()voidmarkInitialState()voidrestoreState(FacesContext facesContext, Object state)ObjectsaveState(FacesContext facesContext)voidsetCurrencyCode(String currencyCode)voidsetCurrencySymbol(String currencySymbol)voidsetGroupingUsed(boolean groupingUsed)voidsetIntegerOnly(boolean integerOnly)voidsetLocale(Locale locale)voidsetMaxFractionDigits(int maxFractionDigits)voidsetMaxIntegerDigits(int maxIntegerDigits)voidsetMinFractionDigits(int minFractionDigits)voidsetMinIntegerDigits(int minIntegerDigits)voidsetPattern(String pattern)voidsetTransient(boolean aTransient)voidsetType(String type)
 
- 
- 
- 
Field Detail- 
CONVERTER_IDpublic static final String CONVERTER_ID - See Also:
- Constant Field Values
 
 - 
STRING_IDpublic static final String STRING_ID - See Also:
- Constant Field Values
 
 - 
CURRENCY_IDpublic static final String CURRENCY_ID - See Also:
- Constant Field Values
 
 - 
NUMBER_IDpublic static final String NUMBER_ID - See Also:
- Constant Field Values
 
 - 
PATTERN_IDpublic static final String PATTERN_ID - See Also:
- Constant Field Values
 
 - 
PERCENT_IDpublic static final String PERCENT_ID - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
getAsObjectpublic Object getAsObject(FacesContext facesContext, UIComponent uiComponent, String value) - Specified by:
- getAsObjectin interface- Converter
 
 - 
getAsStringpublic String getAsString(FacesContext facesContext, UIComponent uiComponent, Object value) - Specified by:
- getAsStringin interface- Converter
 
 - 
restoreStatepublic void restoreState(FacesContext facesContext, Object state) - Specified by:
- restoreStatein interface- StateHolder
 
 - 
saveStatepublic Object saveState(FacesContext facesContext) - Specified by:
- saveStatein interface- StateHolder
 
 - 
getCurrencyCode@JSFProperty public String getCurrencyCode() ISO 4217 currency code
 - 
setCurrencyCodepublic void setCurrencyCode(String currencyCode) 
 - 
getCurrencySymbol@JSFProperty public String getCurrencySymbol() The currency symbol used to format a currency value. Defaults to the currency symbol for locale.
 - 
setCurrencySymbolpublic void setCurrencySymbol(String currencySymbol) 
 - 
isGroupingUsed@JSFProperty(deferredValueType="java.lang.Boolean") public boolean isGroupingUsed() Specifies whether output will contain grouping separators. Default: true.
 - 
setGroupingUsedpublic void setGroupingUsed(boolean groupingUsed) 
 - 
isIntegerOnly@JSFProperty(deferredValueType="java.lang.Boolean") public boolean isIntegerOnly() Specifies whether only the integer part of the input will be parsed. Default: false.
 - 
setIntegerOnlypublic void setIntegerOnly(boolean integerOnly) 
 - 
getLocale@JSFProperty(deferredValueType="java.lang.Object") public Locale getLocale() The name of the locale to be used, instead of the default as specified in the faces configuration file.
 - 
setLocalepublic void setLocale(Locale locale) 
 - 
getMaxFractionDigits@JSFProperty(deferredValueType="java.lang.Integer") public int getMaxFractionDigits() The maximum number of digits in the fractional portion of the number.
 - 
setMaxFractionDigitspublic void setMaxFractionDigits(int maxFractionDigits) 
 - 
getMaxIntegerDigits@JSFProperty(deferredValueType="java.lang.Integer") public int getMaxIntegerDigits() The maximum number of digits in the integer portion of the number.
 - 
setMaxIntegerDigitspublic void setMaxIntegerDigits(int maxIntegerDigits) 
 - 
getMinFractionDigits@JSFProperty(deferredValueType="java.lang.Integer") public int getMinFractionDigits() The minimum number of digits in the fractional portion of the number.
 - 
setMinFractionDigitspublic void setMinFractionDigits(int minFractionDigits) 
 - 
getMinIntegerDigits@JSFProperty(deferredValueType="java.lang.Integer") public int getMinIntegerDigits() The minimum number of digits in the integer portion of the number.
 - 
setMinIntegerDigitspublic void setMinIntegerDigits(int minIntegerDigits) 
 - 
getPattern@JSFProperty public String getPattern() A custom Date formatting pattern, in the format used by java.text.SimpleDateFormat.
 - 
setPatternpublic void setPattern(String pattern) 
 - 
isTransientpublic boolean isTransient() - Specified by:
- isTransientin interface- StateHolder
 
 - 
setTransientpublic void setTransient(boolean aTransient) - Specified by:
- setTransientin interface- StateHolder
 
 - 
getType@JSFProperty public String getType() The type of formatting/parsing to be performed. Values include: number, currency, and percent. Default: number.
 - 
setTypepublic void setType(String type) 
 - 
clearInitialStatepublic void clearInitialState() - Specified by:
- clearInitialStatein interface- PartialStateHolder
 
 - 
initialStateMarkedpublic boolean initialStateMarked() - Specified by:
- initialStateMarkedin interface- PartialStateHolder
 
 - 
markInitialStatepublic void markInitialState() - Specified by:
- markInitialStatein interface- PartialStateHolder
 
 
- 
 
-