public class ZipCodeValidator extends AbstractValidator
ZipCodeOfCountry
Constructor and Description |
---|
ZipCodeValidator() |
Modifier and Type | Method and Description |
---|---|
Iso3166Country |
getCountry()
Gets the country.
|
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 |
setCountry(Iso3166Country country)
Sets the country.
|
void |
validate(javax.faces.context.FacesContext facesContext,
javax.faces.component.UIComponent component,
Object zipCode)
Validates the supplied zipCode.
|
getFormattedErrorMessage, getMessage, hasMessage, isComponentOfTypeUIInput, setMessage
isTransient, setTransient
public Iso3166Country getCountry()
public void setCountry(Iso3166Country country)
country
- The country.public void validate(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent component, Object zipCode)
UIInput
facesContext
- The FacesContext.component
- The component that needs to be validated.zipCode
- The zip code that needs to be validated.NullPointerException
- When either the supplied facesContext or component is null.javax.faces.validator.ValidatorException
- When the supplied zipCode is not a valid zip code.public Object saveState(javax.faces.context.FacesContext facesContext)
saveState
in interface javax.faces.component.StateHolder
saveState
in class AbstractValidator
facesContext
- The FacesContext.public void restoreState(javax.faces.context.FacesContext facesContext, Object state)
saveState(FacesContext)
.restoreState
in interface javax.faces.component.StateHolder
restoreState
in class AbstractValidator
facesContext
- The FacesContext.state
- The state saved by saveState(FacesContext)
.Copyright © 2008–2018. All rights reserved.