JSF-Spring

de.mindmatters.faces.application
Interface ValidatorFactory


public interface ValidatorFactory

Factory for managing Validators. Used by ApplicationImpl.

Author:
Andreas Kuhrwahl

Method Summary
 void addValidator(Application application, java.lang.String validatorId, java.lang.String validatorClass)
          Register a new mapping of validator id to the name of the corresponding Validator class.
 Validator createValidator(Application application, java.lang.String validatorId)
          Instantiate and return a new Validator instance of the class specified by a previous call to addValidator() for the specified validator id.
 java.util.Iterator getValidatorIds(Application application)
          Return an Iterator over the set of currently registered validator ids for this Application.
 

Method Detail

addValidator

void addValidator(Application application,
                  java.lang.String validatorId,
                  java.lang.String validatorClass)
Register a new mapping of validator id to the name of the corresponding Validator class. This allows subsequent calls to createValidator() to serve as a factory for Validator instances.

Parameters:
application - the original Application of the underlying JSF implementation
validatorId - The validator id to be registered
validatorClass - The fully qualified class name of the corresponding Validator implementation
Throws:
java.lang.NullPointerException - if validatorId or validatorClass is null

createValidator

Validator createValidator(Application application,
                          java.lang.String validatorId)
Instantiate and return a new Validator instance of the class specified by a previous call to addValidator() for the specified validator id.

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

getValidatorIds

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

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

JSF-Spring

Copyright © 2006 mindmatters GmbH & Co. KG