de.smartics.validation.constraints.impl
Class NullButNotBlankValidator

java.lang.Object
  extended by de.smartics.validation.constraints.impl.NullButNotBlankValidator
All Implemented Interfaces:
javax.validation.ConstraintValidator< NullButNotBlank, String>

public class NullButNotBlankValidator
     
     
extends Object
implements javax.validation.ConstraintValidator< NullButNotBlank, String>

Check that the String value is either null or, if not null, it is not empty or contains only whitespaces.


Constructor Summary
NullButNotBlankValidator()
           
 
Method Summary
 void initialize(NullButNotBlank constraintAnnotation)
           
 boolean isValid(String value, javax.validation.ConstraintValidatorContext constraintValidatorContext)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NullButNotBlankValidator

public NullButNotBlankValidator()
Method Detail

initialize

public void initialize(NullButNotBlank constraintAnnotation)
Specified by:
initialize in interface javax.validation.ConstraintValidator<NullButNotBlank,String>

isValid

public boolean isValid(String value,
                       javax.validation.ConstraintValidatorContext constraintValidatorContext)
Specified by:
isValid in interface javax.validation.ConstraintValidator<NullButNotBlank,String>


Copyright © 2009-2013 Kronseder & Reiner GmbH - smartics. All Rights Reserved.