org.apache.bval.constraints
Class SizeValidatorForString
java.lang.Object
org.apache.bval.constraints.SizeValidator
org.apache.bval.constraints.SizeValidatorForString
- All Implemented Interfaces:
- ConstraintValidator<Size,String>
public class SizeValidatorForString
- extends SizeValidator
- implements ConstraintValidator<Size,String>
Check that a string's length is between min and max.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SizeValidatorForString
public SizeValidatorForString()
isValid
public boolean isValid(String s,
ConstraintValidatorContext context)
- Checks the length of the specified string.
- Specified by:
isValid in interface ConstraintValidator<Size,String>
- Parameters:
s - The string to validate.context - context in which the constraint is evaluated.
- Returns:
- Returns
true if the string is null or the length of s between the specified
min and max values (inclusive), false otherwise.
Copyright © 2010-2012 The Apache Software Foundation. All Rights Reserved.