org.apache.shale.validator.converter
Class AbstractConverter

java.lang.Object
  extended by org.apache.shale.validator.util.AbstractUtilities
      extended by org.apache.shale.validator.converter.AbstractConverter
All Implemented Interfaces:
javax.faces.component.StateHolder, javax.faces.convert.Converter
Direct Known Subclasses:
DoubleConverter, FloatConverter, IntegerConverter, LongConverter, ShortConverter

public abstract class AbstractConverter
extends AbstractUtilities
implements javax.faces.convert.Converter

Abstract base class for converters that use Apache Commons Validator as their foundation.


Field Summary
 
Fields inherited from class org.apache.shale.validator.util.AbstractUtilities
DEFAULT_RESOURCE_BUNDLE
 
Constructor Summary
AbstractConverter()
           
 
Method Summary
abstract  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.
abstract  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.
 
Methods inherited from class org.apache.shale.validator.util.AbstractUtilities
getMessage, isTransient, message, message, message, restoreState, saveState, setMessage, setTransient
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractConverter

public AbstractConverter()
Method Detail

getAsObject

public abstract 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
Parameters:
context - FacesContext for the current request
component - UIComponent associated with the value to be converted
value - String value to be converted
Throws:
ConverterException - if conversion cannot be successfully performed
NullPointerException - if context or component is null

getAsString

public abstract 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
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
Throws:
ConverterException - if conversion cannot be successfully performed
NullPointerException - if context or component is null


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