public class SizeValidatorForArray extends Object implements ConstraintValidator<Size,Object[]>
Constructor and Description |
---|
SizeValidatorForArray() |
Modifier and Type | Method and Description |
---|---|
void |
initialize(Size parameters) |
boolean |
isValid(Object[] array,
ConstraintValidatorContext constraintValidatorContext)
Checks the number of entries in an array.
|
public void initialize(Size parameters)
initialize
in interface ConstraintValidator<Size,Object[]>
public boolean isValid(Object[] array, ConstraintValidatorContext constraintValidatorContext)
isValid
in interface ConstraintValidator<Size,Object[]>
array
- The array to validate.constraintValidatorContext
- context in which the constraint is evaluated.true
if the array is null
or the number of entries in
array
is between the specified min
and max
values (inclusive),
false
otherwise.Copyright © 2007-2014 Red Hat Middleware, LLC. All Rights Reserved