Class LongRangeValidator

java.lang.Object
jakarta.faces.validator.LongRangeValidator
All Implemented Interfaces:
PartialStateHolder, StateHolder, Validator, EventListener

public class LongRangeValidator extends Object implements Validator, PartialStateHolder

LongRangeValidator is a Validator that checks the value of the corresponding component against specified minimum and maximum values. The following algorithm is implemented:

  • If the passed value is null, exit immediately.
  • If the current component value is not a floating point type, or a String that is convertible to long, throw a ValidatorException containing a TYPE_MESSAGE_ID message.
  • If both a maximum and minimum property has been configured on this Validator, check the component value against both limits. If the component value is not within this specified range, throw a ValidatorException containing a NOT_IN_RANGE_MESSAGE_ID message.
  • If a maximum property has been configured on this Validator, check the component value against this limit. If the component value is greater than the specified maximum, throw a ValidatorException containing a MAXIMUM_MESSAGE_ID message.
  • If a minimum property has been configured on this Validator, check the component value against this limit. If the component value is less than the specified minimum, throw a ValidatorException containing a MINIMUM_MESSAGE_ID message.

For all of the above cases that cause a ValidatorException to be thrown, if there are parameters to the message that match up with validator parameters, the values of these parameters must be converted using the Converter registered in the application under the converter id jakarta.faces.Number. This allows the values to be localized according to the current Locale.