|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.globalmentor.beans.BoundPropertyObject
com.guiseframework.event.GuiseBoundPropertyObject
com.guiseframework.validator.AbstractValidator<com.globalmentor.iso.idcard.PAN>
com.guiseframework.validator.PANValidator
public class PANValidator
A validator to validate a Primary Account Number (PAN) of an identification card as defined in ISO/IEC 7812-1:2000(E), "Identification cards - Identification of issuers - Part 1: Numbering system". The validator ensures that the PAN represents one of the allowed ID card products. PANs for unknown products are considered invalid.
IDCard| Field Summary | |
|---|---|
static java.lang.String |
VALID_PRODUCTS_PROPERTY
The valid products bound property. |
| Fields inherited from class com.globalmentor.beans.BoundPropertyObject |
|---|
NO_PROPERTY_CHANGE_LISTENERS, NO_VETOABLE_CHANGE_LISTENERS |
| Fields inherited from interface com.guiseframework.validator.Validator |
|---|
INVALID_VALUE_MESSAGE_PROPERTY, VALUE_REQUIRED_MESSAGE_PROPERTY, VALUE_REQUIRED_PROPERTY |
| Constructor Summary | |
|---|---|
PANValidator(boolean valueRequired)
Value required constructor accepting all known products. |
|
PANValidator(boolean valueRequired,
com.globalmentor.iso.idcard.Product... validProducts)
Value required and valid products constructor. |
|
PANValidator(com.globalmentor.iso.idcard.Product... validProducts)
Valid products constructor with no value required. |
|
| Method Summary | |
|---|---|
java.util.Set<com.globalmentor.iso.idcard.Product> |
getValidProducts()
|
void |
setValidProducts(com.globalmentor.iso.idcard.Product... validProducts)
Sets the PAN products that the validator considers valid. |
void |
setValidProducts(java.util.Set<com.globalmentor.iso.idcard.Product> newValidProducts)
Sets the PAN products that the validator considers valid. |
void |
validate(com.globalmentor.iso.idcard.PAN value)
Checks whether a given value is valid, and throws an exception if not. |
| Methods inherited from class com.guiseframework.validator.AbstractValidator |
|---|
getInvalidValueMessage, getValueRequiredMessage, isValid, isValueRequired, setInvalidValueMessage, setValueRequired, setValueRequiredMessage, throwInvalidValueValidationException, throwValueRequiredValidationException, toString |
| Methods inherited from class com.guiseframework.event.GuiseBoundPropertyObject |
|---|
getSession |
| Methods inherited from class com.globalmentor.beans.BoundPropertyObject |
|---|
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, createPostponedPropertyChangeEvent, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, getForwardPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, getPropertyChangeSupport, getRepeatPropertyChangeListener, getRepeatVetoableChangeListener, getVetoableChangeListeners, getVetoableChangeListeners, getVetoableChangeSupport, hasPropertyChangeListeners, hasVetoableChangeListeners, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.guiseframework.validator.Validator |
|---|
getSession |
| Methods inherited from interface com.globalmentor.beans.PropertyBindable |
|---|
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, hasPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener |
| Field Detail |
|---|
public static final java.lang.String VALID_PRODUCTS_PROPERTY
| Constructor Detail |
|---|
public PANValidator(com.globalmentor.iso.idcard.Product... validProducts)
validProducts - The products that are allowed, if any.
java.lang.NullPointerException - if the given array of valid products is null.public PANValidator(boolean valueRequired)
valueRequired - Whether the value must be non-null in order to be considered valid.
public PANValidator(boolean valueRequired,
com.globalmentor.iso.idcard.Product... validProducts)
valueRequired - Whether the value must be non-null in order to be considered valid.validProducts - The products that are allowed, if any.
java.lang.NullPointerException - if the given array of valid products is null.| Method Detail |
|---|
public java.util.Set<com.globalmentor.iso.idcard.Product> getValidProducts()
public void setValidProducts(java.util.Set<com.globalmentor.iso.idcard.Product> newValidProducts)
newValidProducts - The set of valid products.
java.lang.NullPointerException - if the given set of valid products is null.VALID_PRODUCTS_PROPERTYpublic void setValidProducts(com.globalmentor.iso.idcard.Product... validProducts)
setValidProducts(Set)
validProducts - The products that are allowed, if any.
java.lang.NullPointerException - if the given array of valid products is null.VALID_PRODUCTS_PROPERTY
public void validate(com.globalmentor.iso.idcard.PAN value)
throws ValidationException
validate in interface Validator<com.globalmentor.iso.idcard.PAN>validate in class AbstractValidator<com.globalmentor.iso.idcard.PAN>value - The value to validate.
ValidationException - if the provided value is not valid.AbstractValidator.throwInvalidValueValidationException(Object),
AbstractValidator.throwValueRequiredValidationException(Object)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||