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(FacesContext ctx,
EditableValueHolder editableValueHolder)
Creates and installs default validators, if any, into the argument
EditableValueHolder . |
void |
addValidators(FacesContext ctx,
EditableValueHolder editableValueHolder)
Based on the
ValidatorInfo instances present on the stack,
configure the argument EditableValueHolder with Validator s
created from the available info. |
static ComponentValidators |
getValidators(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(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 null
public static void addDefaultValidatorsToComponent(FacesContext ctx, 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 Validator
spublic void addValidators(FacesContext ctx, EditableValueHolder editableValueHolder)
Based on the ValidatorInfo
instances present on the stack,
configure the argument EditableValueHolder
with Validator
s
created from the available info.
ctx
- the FacesContext
for the current requesteditableValueHolder
- the component receiving the Validator
spublic void pushValidatorInfo(ComponentValidators.ValidatorInfo info)
Pushes the provided ValidatorInfo
onto the stack.
info
- public void popValidatorInfo()
Pops the last ValidatorInfo
instance from the stack.
Comments to: faces-dev@eclipse.org.
Copyright © 2019 Eclipse Foundation. All rights reserved.
Use is subject to license terms.