javax.faces.convert
Class NumberConverter

java.lang.Object
  extended by javax.faces.convert.NumberConverter
All Implemented Interfaces:
PartialStateHolder, StateHolder, Converter

@JSFConverter(name="f:convertNumber",
              bodyContent="empty",
              tagClass="org.apache.myfaces.taglib.core.ConvertNumberTag")
@JSFJspProperty(name="binding",
                returnType="javax.faces.convert.NumberConverter",
                longDesc="A ValueExpression that evaluates to a NumberConverter.")
public class NumberConverter
extends java.lang.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 JSF Specification

Version:
$Revision: 882743 $ $Date: 2009-11-20 17:28:21 -0500 (Fri, 20 Nov 2009) $
Author:
Thomas Spiegl (latest modification by $Author: lu4242 $)

Field Summary
static java.lang.String CONVERTER_ID
           
static java.lang.String CURRENCY_ID
           
static java.lang.String NUMBER_ID
           
static java.lang.String PATTERN_ID
           
static java.lang.String PERCENT_ID
           
static java.lang.String STRING_ID
           
 
Constructor Summary
NumberConverter()
           
 
Method Summary
 void clearInitialState()
           
 java.lang.Object getAsObject(FacesContext facesContext, UIComponent uiComponent, java.lang.String value)
           
 java.lang.String getAsString(FacesContext facesContext, UIComponent uiComponent, java.lang.Object value)
           
 java.lang.String getCurrencyCode()
          ISO 4217 currency code
 java.lang.String getCurrencySymbol()
          The currency symbol used to format a currency value.
 java.util.Locale getLocale()
          The name of the locale to be used, instead of the default as specified in the faces configuration file.
 int getMaxFractionDigits()
          The maximum number of digits in the fractional portion of the number.
 int getMaxIntegerDigits()
          The maximum number of digits in the integer portion of the number.
 int getMinFractionDigits()
          The minimum number of digits in the fractional portion of the number.
 int getMinIntegerDigits()
          The minimum number of digits in the integer portion of the number.
 java.lang.String getPattern()
          A custom Date formatting pattern, in the format used by java.text.SimpleDateFormat.
 java.lang.String getType()
          The type of formatting/parsing to be performed.
 boolean initialStateMarked()
           
 boolean isGroupingUsed()
          Specifies whether output will contain grouping separators.
 boolean isIntegerOnly()
          Specifies whether only the integer part of the input will be parsed.
 boolean isTransient()
           
 void markInitialState()
           
 void restoreState(FacesContext facesContext, java.lang.Object state)
           
 java.lang.Object saveState(FacesContext facesContext)
           
 void setCurrencyCode(java.lang.String currencyCode)
           
 void setCurrencySymbol(java.lang.String currencySymbol)
           
 void setGroupingUsed(boolean groupingUsed)
           
 void setIntegerOnly(boolean integerOnly)
           
 void setLocale(java.util.Locale locale)
           
 void setMaxFractionDigits(int maxFractionDigits)
           
 void setMaxIntegerDigits(int maxIntegerDigits)
           
 void setMinFractionDigits(int minFractionDigits)
           
 void setMinIntegerDigits(int minIntegerDigits)
           
 void setPattern(java.lang.String pattern)
           
 void setTransient(boolean aTransient)
           
 void setType(java.lang.String type)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONVERTER_ID

public static final java.lang.String CONVERTER_ID
See Also:
Constant Field Values

STRING_ID

public static final java.lang.String STRING_ID
See Also:
Constant Field Values

CURRENCY_ID

public static final java.lang.String CURRENCY_ID
See Also:
Constant Field Values

NUMBER_ID

public static final java.lang.String NUMBER_ID
See Also:
Constant Field Values

PATTERN_ID

public static final java.lang.String PATTERN_ID
See Also:
Constant Field Values

PERCENT_ID

public static final java.lang.String PERCENT_ID
See Also:
Constant Field Values
Constructor Detail

NumberConverter

public NumberConverter()
Method Detail

getAsObject

public java.lang.Object getAsObject(FacesContext facesContext,
                                    UIComponent uiComponent,
                                    java.lang.String value)
Specified by:
getAsObject in interface Converter

getAsString

public java.lang.String getAsString(FacesContext facesContext,
                                    UIComponent uiComponent,
                                    java.lang.Object value)
Specified by:
getAsString in interface Converter

restoreState

public void restoreState(FacesContext facesContext,
                         java.lang.Object state)
Specified by:
restoreState in interface StateHolder

saveState

public java.lang.Object saveState(FacesContext facesContext)
Specified by:
saveState in interface StateHolder

getCurrencyCode

@JSFProperty
public java.lang.String getCurrencyCode()
ISO 4217 currency code


setCurrencyCode

public void setCurrencyCode(java.lang.String currencyCode)

getCurrencySymbol

@JSFProperty
public java.lang.String getCurrencySymbol()
The currency symbol used to format a currency value. Defaults to the currency symbol for locale.


setCurrencySymbol

public void setCurrencySymbol(java.lang.String currencySymbol)

isGroupingUsed

@JSFProperty(deferredValueType="java.lang.Boolean")
public boolean isGroupingUsed()
Specifies whether output will contain grouping separators. Default: true.


setGroupingUsed

public 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.


setIntegerOnly

public void setIntegerOnly(boolean integerOnly)

getLocale

@JSFProperty(deferredValueType="java.lang.Object")
public java.util.Locale getLocale()
The name of the locale to be used, instead of the default as specified in the faces configuration file.


setLocale

public void setLocale(java.util.Locale locale)

getMaxFractionDigits

@JSFProperty(deferredValueType="java.lang.Integer")
public int getMaxFractionDigits()
The maximum number of digits in the fractional portion of the number.


setMaxFractionDigits

public 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.


setMaxIntegerDigits

public 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.


setMinFractionDigits

public 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.


setMinIntegerDigits

public void setMinIntegerDigits(int minIntegerDigits)

getPattern

@JSFProperty
public java.lang.String getPattern()
A custom Date formatting pattern, in the format used by java.text.SimpleDateFormat.


setPattern

public void setPattern(java.lang.String pattern)

isTransient

public boolean isTransient()
Specified by:
isTransient in interface StateHolder

setTransient

public void setTransient(boolean aTransient)
Specified by:
setTransient in interface StateHolder

getType

@JSFProperty
public java.lang.String getType()
The type of formatting/parsing to be performed. Values include: number, currency, and percent. Default: number.


setType

public void setType(java.lang.String type)

clearInitialState

public void clearInitialState()
Specified by:
clearInitialState in interface PartialStateHolder

initialStateMarked

public boolean initialStateMarked()
Specified by:
initialStateMarked in interface PartialStateHolder

markInitialState

public void markInitialState()
Specified by:
markInitialState in interface PartialStateHolder


Copyright © 2010 The Apache Software Foundation. All Rights Reserved.