|
|||||||||
| 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<V>
com.guiseframework.validator.AbstractRegularExpressionValidator<V>
V - The value type this validator supports.public abstract class AbstractRegularExpressionValidator<V>
An abstract validator that can validate against regular expressions.
| Field Summary |
|---|
| 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 | |
|---|---|
AbstractRegularExpressionValidator(java.util.regex.Pattern pattern)
Constructs a string regular expression validator from a regular expression pattern, without requiring a non- null value. |
|
AbstractRegularExpressionValidator(java.util.regex.Pattern pattern,
boolean valueRequired)
Constructs a string regular expression validator from a regular expression pattern. |
|
AbstractRegularExpressionValidator(java.lang.String regularExpression)
Constructs a string regular expression validator from a regular expression string, without requiring a non- null value.. |
|
AbstractRegularExpressionValidator(java.lang.String regularExpression,
boolean valueRequired)
Constructs a string regular expression validator from a regular expression string. |
|
| Method Summary | |
|---|---|
java.util.regex.Pattern |
getPattern()
|
protected abstract java.lang.String |
toString(V value)
Returns a string representation of the given value so that it may be validated against the regular expression. |
void |
validate(V value)
Checks whether a given string matches the regular expression. |
| Methods inherited from class com.guiseframework.validator.AbstractValidator |
|---|
getInvalidValueMessage, getValueRequiredMessage, isValid, isValueRequired, setInvalidValueMessage, setValueRequired, setValueRequiredMessage, throwInvalidValueValidationException, throwValueRequiredValidationException |
| 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 |
| Constructor Detail |
|---|
public AbstractRegularExpressionValidator(java.lang.String regularExpression)
null value..
regularExpression - The regular expression against which to validate string values.
java.lang.NullPointerException - if the given regular expression is null.
public AbstractRegularExpressionValidator(java.lang.String regularExpression,
boolean valueRequired)
regularExpression - The regular expression against which to validate string values.valueRequired - Whether the value must be non-null in order to be considered valid.
java.lang.NullPointerException - if the given regular expression is null.public AbstractRegularExpressionValidator(java.util.regex.Pattern pattern)
null value.
pattern - The regular expression pattern against which to validate string values.
java.lang.NullPointerException - if the given regular expression pattern is null.
public AbstractRegularExpressionValidator(java.util.regex.Pattern pattern,
boolean valueRequired)
pattern - The regular expression pattern against which to validate string values.valueRequired - Whether the value must be non-null in order to be considered valid.
java.lang.NullPointerException - if the given regular expression pattern is null.| Method Detail |
|---|
public java.util.regex.Pattern getPattern()
protected abstract java.lang.String toString(V value)
toString in class AbstractValidator<V>value - The value being validated.
null if the value is null.
public void validate(V value)
throws ValidationException
validate in interface Validator<V>validate in class AbstractValidator<V>value - The value to validate.
ValidationException - if the provided value is not valid.getPattern()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||