JSF-Spring

de.mindmatters.faces.application
Interface ComponentFactory

All Known Implementing Classes:
IdForcingComponentFactory

public interface ComponentFactory

Factory for managing UIComponents. Used by ApplicationImpl.

Author:
Andreas Kuhrwahl

Method Summary
 void addComponent(Application application, java.lang.String componentType, java.lang.String componentClass)
          Register a new mapping of component type to the name of the corresponding UIComponent class.
 UIComponent createComponent(Application application, java.lang.String componentType)
          Instantiate and return a new UIComponent instance of the class specified by a previous call to addComponent() for the specified component type.
 UIComponent createComponent(Application application, ValueBinding componentBinding, FacesContext context, java.lang.String componentType)
          Call the getValue() method on the specified ValueBinding.
 java.util.Iterator getComponentTypes(Application application)
          Return an Iterator over the set of currently defined component types for this Application.
 

Method Detail

addComponent

void addComponent(Application application,
                  java.lang.String componentType,
                  java.lang.String componentClass)
Register a new mapping of component type to the name of the corresponding UIComponent class. This allows subsequent calls to createComponent() to serve as a factory for UIComponent instances.

Parameters:
application - the original Application of the underlying JSF implementation
componentType - The component type to be registered
componentClass - The fully qualified class name of the corresponding UIComponent implementation
Throws:
java.lang.NullPointerException - if componentType or componentClass is null

createComponent

UIComponent createComponent(Application application,
                            java.lang.String componentType)
Instantiate and return a new UIComponent instance of the class specified by a previous call to addComponent() for the specified component type.

Parameters:
application - the original Application of the underlying JSF implementation
componentType - The component type for which to create and return a new UIComponent instance
Returns:
The created component
Throws:
FacesException - if a UIComponent of the specified type cannot be created
java.lang.NullPointerException - if componentType is null

createComponent

UIComponent createComponent(Application application,
                            ValueBinding componentBinding,
                            FacesContext context,
                            java.lang.String componentType)
Call the getValue() method on the specified ValueBinding. If it returns a UIComponent instance, return it as the value of this method. If it does not, instantiate a new UIComponent instance of the specified component type, pass the new component to the setValue() method of the specified ValueBinding, and return it.

Parameters:
application - the original Application of the underlying JSF implementation
componentBinding - ValueBinding representing a component value binding expression (typically specified by the component attribute of a custom tag)
context - FacesContext for the current request
componentType - Component type to create if the ValueBinding does not return a component instance
Returns:
The created component
Throws:
FacesException - if a UIComponent cannot be created
java.lang.NullPointerException - if any parameter is null

getComponentTypes

java.util.Iterator getComponentTypes(Application application)
Return an Iterator over the set of currently defined component types for this Application.

Parameters:
application - the original Application of the underlying JSF implementation
Returns:
An Iterator over the set of currently defined component types

JSF-Spring

Copyright © 2006 mindmatters GmbH & Co. KG