In some instances it may be best to wrap a validator and not create a subclass. The payload schema supports the wrapping-validator-instance
attribute that allow you to wrap a validator. It contains the following wrappers that can serve as a base class:
validatorWrapperImpl
– Implements theValidator
andValidatorWrapper
interfaces and delegates to the wrapped validatorUpdatingValidatorWrapperImpl
– ExtendsvalidatorWrapperImpl
and adds support for theUpdatingValidator
interface
Note that you should only wrap UpdatingValidator
with wrappers that also implement UpdatingValidator
. If you do not, the updatedBeanValue
method will never be called on the wrapped UpdatingValidator
, and will bypass any custom logic that may be contained within the method.