public class ComponentValidators extends Object
This class is responsible for adding default validators and/or validators
that wrap multiple EditableValueHolder instances within the view.
| Modifier and Type | Class and Description |
|---|---|
static class |
ComponentValidators.ValidatorInfo
Generic information container for a validator at a particular
nesting Level.
|
| Constructor and Description |
|---|
ComponentValidators() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addDefaultValidatorsToComponent(javax.faces.context.FacesContext ctx,
javax.faces.component.EditableValueHolder editableValueHolder)
Creates and installs default validators, if any, into the argument
EditableValueHolder. |
void |
addValidators(javax.faces.context.FacesContext ctx,
javax.faces.component.EditableValueHolder editableValueHolder)
Based on the
ValidatorInfo instances present on the stack,
configure the argument EditableValueHolder with Validators
created from the available info. |
static ComponentValidators |
getValidators(javax.faces.context.FacesContext context,
boolean createIfNull) |
void |
popValidatorInfo()
Pops the last
ValidatorInfo instance from the stack. |
void |
pushValidatorInfo(ComponentValidators.ValidatorInfo info)
Pushes the provided
ValidatorInfo onto the stack. |
public static ComponentValidators getValidators(javax.faces.context.FacesContext context, boolean createIfNull)
context - the FacesContext for the current requestcreateIfNull - flag indicating whether or not a
ComponentValidators instance should be created or notComponentValidators instance for processing
a view request. If createIfNull is false
and no ComponentValidators has been created, this method
will return nullpublic static void addDefaultValidatorsToComponent(javax.faces.context.FacesContext ctx,
javax.faces.component.EditableValueHolder editableValueHolder)
Creates and installs default validators, if any, into the argument
EditableValueHolder. This method is merely a utility
method to be called when there is no ComponentValidators
available, or there are no ValidatorInfo instances on the
stack.
ctx - the FacesContext for the current requesteditableValueHolder - the component receiving the Validatorspublic void addValidators(javax.faces.context.FacesContext ctx,
javax.faces.component.EditableValueHolder editableValueHolder)
Based on the ValidatorInfo instances present on the stack,
configure the argument EditableValueHolder with Validators
created from the available info.
ctx - the FacesContext for the current requesteditableValueHolder - the component receiving the Validatorspublic void pushValidatorInfo(ComponentValidators.ValidatorInfo info)
Pushes the provided ValidatorInfo onto the stack.
info - public void popValidatorInfo()
Pops the last ValidatorInfo instance from the stack.
Copyright © 2010–2020 JBoss by Red Hat. All rights reserved.