@ApplicationScoped public class ValidatorManager extends Object implements ValidatorProvider
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.
OmniApplication
Constructor and Description |
---|
ValidatorManager() |
Modifier and Type | Method and Description |
---|---|
Validator |
createValidator(Application application,
String validatorId)
Returns the validator instance associated with the given validator ID,
or
null if there is none. |
public Validator createValidator(Application application, String validatorId)
ValidatorProvider
null
if there is none.createValidator
in interface ValidatorProvider
application
- The involved JSF application.validatorId
- The validator ID of the desired validator instance.null
if there is none.