org.hibernate.validator.constraints.impl
Class SizeValidatorForMap

java.lang.Object
  extended by org.hibernate.validator.constraints.impl.SizeValidatorForMap
All Implemented Interfaces:
ConstraintValidator<Size,Map<?,?>>

public class SizeValidatorForMap
extends Object
implements ConstraintValidator<Size,Map<?,?>>

Check that a string's length is between min and max.

Author:
Hardy Ferentschik

Constructor Summary
SizeValidatorForMap()
           
 
Method Summary
 void initialize(Size parameters)
           
 boolean isValid(Map<?,?> map, ConstraintValidatorContext constraintValidatorContext)
          Checks the number of entries in a map.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SizeValidatorForMap

public SizeValidatorForMap()
Method Detail

initialize

public void initialize(Size parameters)
Specified by:
initialize in interface ConstraintValidator<Size,Map<?,?>>

isValid

public boolean isValid(Map<?,?> map,
                       ConstraintValidatorContext constraintValidatorContext)
Checks the number of entries in a map.

Specified by:
isValid in interface ConstraintValidator<Size,Map<?,?>>
Parameters:
map - The map to validate.
constraintValidatorContext - context in which the constraint is evaluated.
Returns:
Returns true if the map is null or the number of entries in map is between the specified min and max values (inclusive), false otherwise.


Copyright © 2007-2011 Red Hat Middleware, LLC. All Rights Reserved