org.jarbframework.validation
Class DatabaseConstraintValidationContext.ViolationBuilder

java.lang.Object
  extended by org.jarbframework.validation.DatabaseConstraintValidationContext.ViolationBuilder
Enclosing class:
DatabaseConstraintValidationContext

public class DatabaseConstraintValidationContext.ViolationBuilder
extends Object

Used to build and include a new constraint violation to our context.


Method Summary
 DatabaseConstraintValidationContext addToContext()
          Finish building and include the violation to our context.
 DatabaseConstraintValidationContext.ViolationBuilder attribute(String attribute, Object value)
          Configure an attribute value inside the message template.
 DatabaseConstraintValidationContext.ViolationBuilder value(Object value)
          Configure the rejected property value, usable inside our message template.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

attribute

public DatabaseConstraintValidationContext.ViolationBuilder attribute(String attribute,
                                                                      Object value)
Configure an attribute value inside the message template.

Parameters:
attribute - name of the attribute
value - the attribute value that should be used
Returns:
this builder instance

value

public DatabaseConstraintValidationContext.ViolationBuilder value(Object value)
Configure the rejected property value, usable inside our message template.

Parameters:
value - the rejected property value
Returns:
this builder instance

addToContext

public DatabaseConstraintValidationContext addToContext()
Finish building and include the violation to our context.

Returns:
the relevant context, capable of building new violation


Copyright © 2011-2012. All Rights Reserved.