Class ComponentValidators
- java.lang.Object
-
- com.sun.faces.component.validator.ComponentValidators
-
public class ComponentValidators extends Object
This class is responsible for adding default validators and/or validators that wrap multiple
EditableValueHolderinstances within the view.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classComponentValidators.ValidatorInfoGeneric information container for a validator at a particular nesting Level.
-
Constructor Summary
Constructors Constructor Description ComponentValidators()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidaddDefaultValidatorsToComponent(FacesContext ctx, EditableValueHolder editableValueHolder)Creates and installs default validators, if any, into the argumentEditableValueHolder.voidaddValidators(FacesContext ctx, EditableValueHolder editableValueHolder)Based on theValidatorInfoinstances present on the stack, configure the argumentEditableValueHolderwithValidators created from the available info.static ComponentValidatorsgetValidators(FacesContext context, boolean createIfNull)voidpopValidatorInfo()Pops the lastValidatorInfoinstance from the stack.voidpushValidatorInfo(ComponentValidators.ValidatorInfo info)Pushes the providedValidatorInfoonto the stack.
-
-
-
Method Detail
-
getValidators
public static ComponentValidators getValidators(FacesContext context, boolean createIfNull)
- Parameters:
context- theFacesContextfor the current requestcreateIfNull- flag indicating whether or not aComponentValidatorsinstance should be created or not- Returns:
- a
ComponentValidatorsinstance for processing a view request. IfcreateIfNullisfalseand noComponentValidatorshas been created, this method will returnnull
-
addDefaultValidatorsToComponent
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 noComponentValidatorsavailable, or there are noValidatorInfoinstances on the stack.- Parameters:
ctx- theFacesContextfor the current requesteditableValueHolder- the component receiving theValidators
-
addValidators
public void addValidators(FacesContext ctx, EditableValueHolder editableValueHolder)
Based on the
ValidatorInfoinstances present on the stack, configure the argumentEditableValueHolderwithValidators created from the available info.- Parameters:
ctx- theFacesContextfor the current requesteditableValueHolder- the component receiving theValidators
-
pushValidatorInfo
public void pushValidatorInfo(ComponentValidators.ValidatorInfo info)
Pushes the provided
ValidatorInfoonto the stack.- Parameters:
info- validator info
-
popValidatorInfo
public void popValidatorInfo()
Pops the last
ValidatorInfoinstance from the stack.
-
-