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, PartialStateHolder
This 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 Faces Specification
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from interface jakarta.faces.convert.ConverterDATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE_PARAM_NAME
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidgetAsObject(FacesContext facesContext, UIComponent uiComponent, String value) getAsString(FacesContext facesContext, UIComponent uiComponent, Object value) ISO 4217 currency codeThe currency symbol used to format a currency value.The name of the locale to be used, instead of the default as specified in the faces configuration file.intThe maximum number of digits in the fractional portion of the number.intThe maximum number of digits in the integer portion of the number.intThe minimum number of digits in the fractional portion of the number.intThe minimum number of digits in the integer portion of the number.A custom Date formatting pattern, in the format used by java.text.SimpleDateFormat.getType()The type of formatting/parsing to be performed.booleanbooleanSpecifies whether output will contain grouping separators.booleanSpecifies whether only the integer part of the input will be parsed.booleanvoidvoidrestoreState(FacesContext facesContext, Object state) saveState(FacesContext facesContext) voidsetCurrencyCode(String currencyCode) voidsetCurrencySymbol(String currencySymbol) voidsetGroupingUsed(boolean groupingUsed) voidsetIntegerOnly(boolean integerOnly) voidvoidsetMaxFractionDigits(int maxFractionDigits) voidsetMaxIntegerDigits(int maxIntegerDigits) voidsetMinFractionDigits(int minFractionDigits) voidsetMinIntegerDigits(int minIntegerDigits) voidsetPattern(String pattern) voidsetTransient(boolean aTransient) void
- 
Field Details- 
CONVERTER_ID- See Also:
 
- 
STRING_ID- See Also:
 
- 
CURRENCY_ID- See Also:
 
- 
NUMBER_ID- See Also:
 
- 
PATTERN_ID- See Also:
 
- 
PERCENT_ID- See Also:
 
 
- 
- 
Constructor Details- 
NumberConverterpublic NumberConverter()
 
- 
- 
Method Details- 
getAsObject- Specified by:
- getAsObjectin interface- Converter
 
- 
getAsString- Specified by:
- getAsStringin interface- Converter
 
- 
restoreState- Specified by:
- restoreStatein interface- StateHolder
 
- 
saveState- Specified by:
- saveStatein interface- StateHolder
 
- 
getCurrencyCodeISO 4217 currency code
- 
setCurrencyCode
- 
getCurrencySymbolThe currency symbol used to format a currency value. Defaults to the currency symbol for locale.
- 
setCurrencySymbol
- 
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) 
- 
getLocaleThe name of the locale to be used, instead of the default as specified in the faces configuration file.
- 
setLocale
- 
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) 
- 
getPatternA custom Date formatting pattern, in the format used by java.text.SimpleDateFormat.
- 
setPattern
- 
isTransientpublic boolean isTransient()- Specified by:
- isTransientin interface- StateHolder
 
- 
setTransientpublic void setTransient(boolean aTransient) - Specified by:
- setTransientin interface- StateHolder
 
- 
getTypeThe type of formatting/parsing to be performed. Values include: number, currency, and percent. Default: number.
- 
setType
- 
clearInitialStatepublic void clearInitialState()- Specified by:
- clearInitialStatein interface- PartialStateHolder
 
- 
initialStateMarkedpublic boolean initialStateMarked()- Specified by:
- initialStateMarkedin interface- PartialStateHolder
 
- 
markInitialStatepublic void markInitialState()- Specified by:
- markInitialStatein interface- PartialStateHolder
 
 
-