JSF-Spring

de.mindmatters.faces.application
Interface ConverterFactory


public interface ConverterFactory

Factory for managing Converters. Used by ApplicationImpl.

Author:
Andreas Kuhrwahl

Method Summary
 void addConverter(Application application, java.lang.Class targetClass, java.lang.String converterClass)
          Register a new converter class that is capable of performing conversions for the specified target class.
 void addConverter(Application application, java.lang.String converterId, java.lang.String converterClass)
          Register a new mapping of converter id to the name of the corresponding Converter class.
 Converter createConverter(Application application, java.lang.Class targetClass)
          Instantiate and return a new Converter instance of the class that has registered itself as capable of performing conversions for objects of the specified type.
 Converter createConverter(Application application, java.lang.String converterId)
          Instantiate and return a new Converter instance of the class specified by a previous call to addConverter() for the specified converter id.
 java.util.Iterator getConverterIds(Application application)
          Return an Iterator over the set of currently registered converter ids for this Application.
 java.util.Iterator getConverterTypes(Application application)
          Return an Iterator over the set of Class instances for which Converter classes have been explicitly registered.
 

Method Detail

addConverter

void addConverter(Application application,
                  java.lang.String converterId,
                  java.lang.String converterClass)
Register a new mapping of converter id to the name of the corresponding Converter class. This allows subsequent calls to createConverter() to serve as a factory for Converter instances.

Parameters:
application - the original Application of the underlying JSF implementation
converterId - The converter id to be registered
converterClass - The fully qualified class name of the corresponding Converter implementation
Throws:
java.lang.NullPointerException - if converterId or converterClass is null

addConverter

void addConverter(Application application,
                  java.lang.Class targetClass,
                  java.lang.String converterClass)
Register a new converter class that is capable of performing conversions for the specified target class.

Parameters:
application - the original Application of the underlying JSF implementation
targetClass - The class for which this converter is registered
converterClass - The fully qualified class name of the corresponding Converter implementation
Throws:
java.lang.NullPointerException - if targetClass or converterClass is null

createConverter

Converter createConverter(Application application,
                          java.lang.String converterId)
Instantiate and return a new Converter instance of the class specified by a previous call to addConverter() for the specified converter id. If there is no such registration for this converter id, return null.

Parameters:
application - the original Application of the underlying JSF implementation
converterId - The converter id for which to create and return a new Converter instance
Returns:
the created Converter
Throws:
FacesException - if the Converter cannot be created
java.lang.NullPointerException - if converterId is null

createConverter

Converter createConverter(Application application,
                          java.lang.Class targetClass)
Instantiate and return a new Converter instance of the class that has registered itself as capable of performing conversions for objects of the specified type. If no such Converter class can be identified, return null.

To locate an appropriate Converter class, the following algorithm is performed, stopping as soon as an appropriate Converter class is found:

Parameters:
application - the original Application of the underlying JSF implementation
targetClass - Target class for which to return a Converter
Returns:
the created Converter
Throws:
FacesException - if the Converter cannot be created
java.lang.NullPointerException - if targetClass is null

getConverterIds

java.util.Iterator getConverterIds(Application application)
Return an Iterator over the set of currently registered converter ids for this Application.

Parameters:
application - the original Application of the underlying JSF implementation
Returns:
An Iterator over the set of currently registered converter ids

getConverterTypes

java.util.Iterator getConverterTypes(Application application)
Return an Iterator over the set of Class instances for which Converter classes have been explicitly registered.

Parameters:
application - the original Application of the underlying JSF implementation
Returns:
An Iterator over the set of Class instances for which Converter classes have been explicitly registered

JSF-Spring

Copyright © 2006 mindmatters GmbH & Co. KG