org.apache.shale.validator.converter
Class DoubleConverter

java.lang.Object
  extended by org.apache.shale.validator.util.AbstractUtilities
      extended by org.apache.shale.validator.converter.AbstractConverter
          extended by org.apache.shale.validator.converter.DoubleConverter
All Implemented Interfaces:
javax.faces.component.StateHolder, javax.faces.convert.Converter

public final class DoubleConverter
extends AbstractConverter

JavaServer Faces Converter for Double (and int) instances. Parsing and formatting is controlled by the properties that are set on a Converter instance.


Field Summary
 
Fields inherited from class org.apache.shale.validator.util.AbstractUtilities
DEFAULT_RESOURCE_BUNDLE
 
Constructor Summary
DoubleConverter()
           
 
Method Summary
 Object getAsObject(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, String value)
          

Convert the specified string value, associated with the specified UIComponent, into a corresponding model data object.

 String getAsString(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, Object value)
          

Convert the specified model data object, associated with the specified UIComponent, into a string suitable for rendering.

 Locale getLocale()
          Return the Locale to apply to this conversion, or null to use the Locale for the current view.
 String getPattern()
          Return the java.text.NumberFormat pattern to apply to this conversion, or null for using no pattern.
 void restoreState(javax.faces.context.FacesContext context, Object state)
          
 Object saveState(javax.faces.context.FacesContext context)
          
 void setLocale(Locale locale)
          Set the Locale to apply to this conversion, or null to use the Locale for the current view.
 void setPattern(String pattern)
          Set the java.text.NumberFormat pattern to apply to this conversion, or null for using no pattern.
 
Methods inherited from class org.apache.shale.validator.util.AbstractUtilities
getMessage, isTransient, message, message, message, setMessage, setTransient
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DoubleConverter

public DoubleConverter()
Method Detail

getLocale

public Locale getLocale()

Return the Locale to apply to this conversion, or null to use the Locale for the current view.


setLocale

public void setLocale(Locale locale)

Set the Locale to apply to this conversion, or null to use the Locale for the current view.

Parameters:
locale - The new Locale

getPattern

public String getPattern()

Return the java.text.NumberFormat pattern to apply to this conversion, or null for using no pattern.


setPattern

public void setPattern(String pattern)

Set the java.text.NumberFormat pattern to apply to this conversion, or null for using no pattern.

Parameters:
pattern - The new formatting pattern

getAsObject

public Object getAsObject(javax.faces.context.FacesContext context,
                          javax.faces.component.UIComponent component,
                          String value)

Convert the specified string value, associated with the specified UIComponent, into a corresponding model data object.

Specified by:
getAsObject in interface javax.faces.convert.Converter
Specified by:
getAsObject in class AbstractConverter
Parameters:
context - FacesContext for the current request
component - UIComponent associated with the value to be converted
value - String value to be converted

getAsString

public String getAsString(javax.faces.context.FacesContext context,
                          javax.faces.component.UIComponent component,
                          Object value)

Convert the specified model data object, associated with the specified UIComponent, into a string suitable for rendering.

Specified by:
getAsString in interface javax.faces.convert.Converter
Specified by:
getAsString in class AbstractConverter
Parameters:
context - FacesContext for the current request
component - UIComponent associated with the model data object to be converted
value - Model data object to be converted

restoreState

public void restoreState(javax.faces.context.FacesContext context,
                         Object state)

Specified by:
restoreState in interface javax.faces.component.StateHolder
Overrides:
restoreState in class AbstractUtilities

saveState

public Object saveState(javax.faces.context.FacesContext context)

Specified by:
saveState in interface javax.faces.component.StateHolder
Overrides:
saveState in class AbstractUtilities


Copyright © 2004-2007 Apache Software Foundation. All Rights Reserved.