Z - type of validatablepublic class RangeValidator<Z extends Comparable<? super Z> & Serializable> extends AbstractRangeValidator<Z,Z>
null they are not checked.
Resource keys:
RangeValidator.exact if min==maxRangeValidator.range if both min and max are not nullRangeValidator.minimum if max is nullRangeValidator.maximum if min is nullError Message Variables:
name: the id of Component that failedlabel: the label of the Component (either comes from
FormComponent.labelModel or resource key <form-id>.<form-component-id>input: the input valueminimum: the minimum allowed valuemaximum: the maximum allowed valueAbstractRangeValidator.Mode| Modifier | Constructor and Description |
|---|---|
protected |
RangeValidator()
Constructor used for subclasses who want to set the range using
AbstractRangeValidator.setRange(Comparable, Comparable) |
|
RangeValidator(Z minimum,
Z maximum)
Constructor that sets the minimum and maximum values.
|
| Modifier and Type | Method and Description |
|---|---|
protected Z |
getValue(IValidatable<Z> validatable)
Gets the value that should be validated against the range
|
static <T extends Comparable<? super T> & Serializable> |
maximum(T maximum) |
static <T extends Comparable<? super T> & Serializable> |
minimum(T minimum) |
static <T extends Comparable<? super T> & Serializable> |
range(T minimum,
T maximum) |
decorate, getMaximum, getMinimum, getMode, setRange, validateafterRender, beforeRender, bind, canCallListenerInterface, detach, getStatelessHint, isEnabled, isTemporary, onComponentTag, onConfigure, onEvent, onException, onRemove, renderHead, unbindpublic RangeValidator(Z minimum, Z maximum)
minimum - the minimum valuemaximum - the maximum valueprotected RangeValidator()
AbstractRangeValidator.setRange(Comparable, Comparable)public static <T extends Comparable<? super T> & Serializable> RangeValidator<T> range(T minimum, T maximum)
minimum - maximum - RangeValidator that validates if a value falls within a rangepublic static <T extends Comparable<? super T> & Serializable> RangeValidator<T> minimum(T minimum)
minimum - RangeValidator that validates if a value is a least minimumpublic static <T extends Comparable<? super T> & Serializable> RangeValidator<T> maximum(T maximum)
maximum - RangeValidator that validates if a value is a most maximumprotected Z getValue(IValidatable<Z> validatable)
AbstractRangeValidatorgetValue in class AbstractRangeValidator<Z extends Comparable<? super Z> & Serializable,Z extends Comparable<? super Z> & Serializable>Copyright © 2006–2021 Apache Software Foundation. All rights reserved.