org.jarbframework.validation
Class DatabaseConstraintValidationContext

java.lang.Object
  extended by org.jarbframework.validation.DatabaseConstraintValidationContext

public final class DatabaseConstraintValidationContext
extends Object

Context of a specific bean validation. Bean violations can be retrieved and included to this context.

Since:
20-10-2011
Author:
Jeroen van Schagen

Nested Class Summary
 class DatabaseConstraintValidationContext.ViolationBuilder
          Used to build and include a new constraint violation to our context.
 
Method Summary
 DatabaseConstraintValidationContext.ViolationBuilder buildViolationWithTemplate(PropertyReference propertyReference, String templateName)
          Start building a new database constraint violation.
 boolean isValid()
          Determine if no violations were detected in this validation context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isValid

public boolean isValid()
Determine if no violations were detected in this validation context.

Returns:
true if no violations were detected, else false

buildViolationWithTemplate

public DatabaseConstraintValidationContext.ViolationBuilder buildViolationWithTemplate(PropertyReference propertyReference,
                                                                                       String templateName)
Start building a new database constraint violation. Note that the violation will only be stored after invoking DatabaseConstraintViolationBuilder#addToContext().

Parameters:
propertyReference - reference to the property that was violated
templateName - name of the message template
Returns:
new database constraint violation builder


Copyright © 2011-2012. All Rights Reserved.