org.apache.bval.model
Interface ValidationListener

All Known Implementing Classes:
ConstraintValidationListener, ValidationResults

public interface ValidationListener

Description: The interface to collect errors found during validation


Nested Class Summary
static class ValidationListener.Error
          An object holding a single validation constraint violation found during the validation process.
 
Method Summary
<T extends ValidationListener>
void
addError(String reason, ValidationContext<T> context)
          Simple API to add an error reason during validation.
<T extends ValidationListener>
void
addError(ValidationListener.Error error, ValidationContext<T> context)
          Alternative method to add a fully initialized ValidationListener.Error object.
 

Method Detail

addError

<T extends ValidationListener> void addError(String reason,
                                             ValidationContext<T> context)
Simple API to add an error reason during validation. Error notification added from a Validation with context information taken from the given ValidationContext.

Parameters:
reason - a constant describing the reason. This is normally the key of the feature that was violated in the object 'owner' for property 'propertyName'
context - - contains bean = the object that contains the error (owner) propertyName = the Name of the attribute that caused the error

addError

<T extends ValidationListener> void addError(ValidationListener.Error error,
                                             ValidationContext<T> context)
Alternative method to add a fully initialized ValidationListener.Error object.



Copyright © 2010-2014 The Apache Software Foundation. All Rights Reserved.