public class PatternValidator extends AbstractValidator
| Constructor and Description |
|---|
PatternValidator() |
| Modifier and Type | Method and Description |
|---|---|
String |
getPattern()
Gets the pattern (regular expression) to validate against.
|
void |
restoreState(javax.faces.context.FacesContext facesContext,
Object state)
Restores the state saved by
saveState(FacesContext). |
Object |
saveState(javax.faces.context.FacesContext facesContext)
Saves the state of this validator.
|
void |
setPattern(String pattern)
Sets the pattern (regular expression) to validate against.
|
void |
validate(javax.faces.context.FacesContext facesContext,
javax.faces.component.UIComponent component,
Object value)
Validates the supplied value against the pattern.
|
getFormattedErrorMessage, getMessage, hasMessage, isComponentOfTypeUIInput, setMessageisTransient, setTransientpublic String getPattern()
Patternpublic void setPattern(String pattern)
pattern - The pattern (regular expression) to validate against.
Patternpublic void validate(javax.faces.context.FacesContext facesContext,
javax.faces.component.UIComponent component,
Object value)
UIInput (*)facesContext - The FacesContext.component - The component that needs to be validated.value - The value of the component that needs to be validated.NullPointerException - When either the supplied facesContext or component is null.javax.faces.validator.ValidatorException - When the supplied value does not match the pattern.public Object saveState(javax.faces.context.FacesContext facesContext)
saveState in interface javax.faces.component.StateHoldersaveState in class AbstractValidatorfacesContext - The FacesContext.public void restoreState(javax.faces.context.FacesContext facesContext,
Object state)
saveState(FacesContext).restoreState in interface javax.faces.component.StateHolderrestoreState in class AbstractValidatorfacesContext - The FacesContext.state - The state saved by saveState(FacesContext).Copyright © 2008–2018. All rights reserved.