javax.validation
Interface ConstraintValidatorContext.ErrorBuilder

Enclosing interface:
ConstraintValidatorContext

public static interface ConstraintValidatorContext.ErrorBuilder

Error builder allowing to optionally associate the error to a sub path. To create the error, one must call either one of the #addError method available in one of the interfaces of the fluent API. If another method is called after #addError() on ErrorBuilder or any of its associated objects an IllegalStateException is raised.


Nested Class Summary
static interface ConstraintValidatorContext.ErrorBuilder.NodeBuilderCustomizableContext
          Represent a subnode whose context is configurable (ie index, key and isInIterable)
static interface ConstraintValidatorContext.ErrorBuilder.NodeBuilderDefinedContext
          Represent a subnode whose context is known (ie index, key and isInIterable)
static interface ConstraintValidatorContext.ErrorBuilder.NodeContextBuilder
          Represent refinement choices for a node which is in an Iterator or Map.
 
Method Summary
 ConstraintValidatorContext addError()
          Add the new error report to be generated if the constraint validator mark the value as invalid.
 ConstraintValidatorContext.ErrorBuilder.NodeBuilderDefinedContext addSubNode(java.lang.String name)
          Add a subNode to the path the error will be associated to.
 

Method Detail

addSubNode

ConstraintValidatorContext.ErrorBuilder.NodeBuilderDefinedContext addSubNode(java.lang.String name)
Add a subNode to the path the error will be associated to. name describes a single property. In particular, dot (.) are not allowed.

Parameters:
name - property name
Returns:
a builder representing node name

addError

ConstraintValidatorContext addError()
Add the new error report to be generated if the constraint validator mark the value as invalid. Methods of this ErrorBuilder instance and its nested objects returns IllegalStateException from now on.

Returns:
ConstraintValidatorContext instance the ErrorBuilder comes from


Copyright © 2007-2009. All Rights Reserved.