org.hibernate.validator.constraints.impl
Class SizeValidatorForArraysOfByte

java.lang.Object
  extended by org.hibernate.validator.constraints.impl.SizeValidatorForArraysOfPrimitives
      extended by org.hibernate.validator.constraints.impl.SizeValidatorForArraysOfByte
All Implemented Interfaces:
ConstraintValidator<Size,byte[]>

public class SizeValidatorForArraysOfByte
extends SizeValidatorForArraysOfPrimitives
implements ConstraintValidator<Size,byte[]>

Author:
Hardy Ferentschik

Field Summary
 
Fields inherited from class org.hibernate.validator.constraints.impl.SizeValidatorForArraysOfPrimitives
max, min
 
Constructor Summary
SizeValidatorForArraysOfByte()
           
 
Method Summary
 boolean isValid(byte[] array, ConstraintValidatorContext constraintValidatorContext)
          Checks the number of entries in an array.
 
Methods inherited from class org.hibernate.validator.constraints.impl.SizeValidatorForArraysOfPrimitives
initialize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.validation.ConstraintValidator
initialize
 

Constructor Detail

SizeValidatorForArraysOfByte

public SizeValidatorForArraysOfByte()
Method Detail

isValid

public boolean isValid(byte[] array,
                       ConstraintValidatorContext constraintValidatorContext)
Checks the number of entries in an array.

Specified by:
isValid in interface ConstraintValidator<Size,byte[]>
Parameters:
array - The array to validate.
constraintValidatorContext - context in which the constraint is evaluated.
Returns:
Returns 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-2010 Red Hat Middleware, LLC. All Rights Reserved