org.omnifaces.cdi.validator
Class ValidatorManager

java.lang.Object
  extended by org.omnifaces.cdi.validator.ValidatorManager
All Implemented Interfaces:
ValidatorProvider

@ApplicationScoped
public class ValidatorManager
extends java.lang.Object
implements ValidatorProvider

Provides access to all FacesValidator annotated Validator instances which are made eligible for CDI.

Previously, in OmniFaces 1.6, all validators were proactively collected in an Extension instance. However, this construct failed when OmniFaces was installed in multiple WARs of an EAR. The extension was EAR-wide, but each WAR got its own instance injected and only one of them will have access to the collected validators. Since OmniFaces 1.6.1, the whole extension is removed and the validators are now lazily collected in this manager class. See also issue 251.

Since:
1.6
Author:
Radu Creanga , Bauke Scholtz
See Also:
OmniApplication

Constructor Summary
ValidatorManager()
           
 
Method Summary
 javax.faces.validator.Validator createValidator(javax.faces.application.Application application, java.lang.String validatorId)
          Returns the validator instance associated with the given validator ID, or null if there is none.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValidatorManager

public ValidatorManager()
Method Detail

createValidator

public javax.faces.validator.Validator createValidator(javax.faces.application.Application application,
                                                       java.lang.String validatorId)
Description copied from interface: ValidatorProvider
Returns the validator instance associated with the given validator ID, or null if there is none.

Specified by:
createValidator in interface ValidatorProvider
Parameters:
application - The involved JSF application.
validatorId - The validator ID of the desired validator instance.
Returns:
the validator instance associated with the given validator ID, or null if there is none.