Class ListValidator

    • Field Detail

      • LIST_VALUES

        public static final String LIST_VALUES
        Parameter which when supplied, specifies the contents of the list. If this value is not supplied, the validator does not check the list contents.
        See Also:
        Constant Field Values
      • MINIMUM_SELECTION

        public static final String MINIMUM_SELECTION
        Parameter which when supplied, specifies the minimum selection for the list. If this value is not supplied, the validator defaults to a minimum selection of 0.
        See Also:
        Constant Field Values
      • MAXIMUM_SELECTION

        public static final String MAXIMUM_SELECTION
        Parameter which when supplied, specifies the maximum selection for the list. If this value is not supplied, the validator defaults to a maximum selection of 1.
        See Also:
        Constant Field Values
      • TRIM

        public static final String TRIM
        Parameter which when supplied, specifies if each value should be preserved or trimmed (String.trim()). If this value is not supplied, the validator trims each value.
        See Also:
        Constant Field Values
    • Constructor Detail

      • ListValidator

        public ListValidator​(MultiMap parameters)
        Constructor.
        Parameters:
        parameters - parameters
    • Method Detail

      • validate

        public final Collection<ValidationError> validate​(ValidationContext context,
                                                          String... values)
        Description copied from interface: Validator
        Validate the supplied values, each value is validated individually.
        Specified by:
        validate in interface Validator
        Parameters:
        context - TODO
        values - the values to validate
        Returns:
        the collection of validation failures
      • isValueRequired

        public boolean isValueRequired()
        Description copied from interface: Validator
        Get if the validator's rules would mean the a field value is required. This is a general hint.
        Specified by:
        isValueRequired in interface Validator
        Returns:
        required