public interface ValidatorListener
Created: June 09 2016
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string
|
Modifier and Type | Method and Description |
---|---|
void |
errorAdded(ValidatorContext pContext,
Validator<?> pValidator,
java.lang.String pMessage,
java.lang.String pPropertyName,
java.lang.Throwable pRootCause)
Called just after an error was added to ValidatorContext.
|
boolean |
forceValidationOfExistingProperty(ValidatorContext pContext,
java.lang.String pPropertyName,
java.lang.Object pSource,
java.lang.Object pDestination)
Give all listeners a chance to say whether a property should be
validated.
|
void |
validateBeanPropertyCalled(ValidatorContext pContext,
Validator pValidator,
java.lang.String pPropertyName,
java.lang.Object pBean,
java.lang.Object pResult)
Called after a beanProperty has been validated.
|
static final java.lang.String CLASS_VERSION
void errorAdded(ValidatorContext pContext, Validator<?> pValidator, java.lang.String pMessage, java.lang.String pPropertyName, java.lang.Throwable pRootCause)
pValidator
- the validator on whose behalf the exception
was added (can provide an errorCode to use).pMessage
- the user visible message (should be localized)pPropertyName
- the property name to append to the pushed
property path on the context. May be null if there is nothing to add.pRootCause
- the throwable to use as a root cause. If non-null,
then pRootCause becomes the nested/caused-by exception.void validateBeanPropertyCalled(ValidatorContext pContext, Validator pValidator, java.lang.String pPropertyName, java.lang.Object pBean, java.lang.Object pResult)
Note that callers of validateBeanProperty() must invoke ValidatorContext.validateBeanPropertyCalled() in order for listeners to get this notification. ValidatorManager (the core bean-property validator) already does so, but not every validator may do so.
pContext
- the current validation context.pValidator
- the validator that did the validation.pPropertyName
- the name of the property that was validated.pBean
- the bean whose property was validated.boolean forceValidationOfExistingProperty(ValidatorContext pContext, java.lang.String pPropertyName, java.lang.Object pSource, java.lang.Object pDestination)
pContext
- the current validation context.pPropertyName
- the name of the property to be validated.pSource
- the bean containing new property values.pDestination
- the bean containing original property values.