org.hibernate.validator.constraints.impl
Class NotBlankValidator

java.lang.Object
  extended by org.hibernate.validator.constraints.impl.NotBlankValidator
All Implemented Interfaces:
ConstraintValidator<NotBlank,String>

public class NotBlankValidator
extends Object
implements ConstraintValidator<NotBlank,String>

Check that a string's trimmed length is not empty.

Author:
Hardy Ferentschik

Constructor Summary
NotBlankValidator()
           
 
Method Summary
 void initialize(NotBlank annotation)
           
 boolean isValid(String s, ConstraintValidatorContext constraintValidatorContext)
          Checks that the trimmed string is not empty.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NotBlankValidator

public NotBlankValidator()
Method Detail

initialize

public void initialize(NotBlank annotation)
Specified by:
initialize in interface ConstraintValidator<NotBlank,String>

isValid

public boolean isValid(String s,
                       ConstraintValidatorContext constraintValidatorContext)
Checks that the trimmed string is not empty.

Specified by:
isValid in interface ConstraintValidator<NotBlank,String>
Parameters:
s - The string to validate.
constraintValidatorContext - 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 © 2007-2010 Red Hat Middleware, LLC. All Rights Reserved