public final class CustomValidatorOperation extends Object
ValidationExtension
which
is capable of executing custom validators provided by a
third party. The Validator
can be provided via a ObjectSource
which means that the user could have specified either a classname or a
named reference to it.
If the user provided a classname, then the Class
that it represents
is expected to have a default public Descriptor
which can be used to
instantiate it.
If the Validator
is provided via a reference, then a lookup
to the MuleRegistry
will be performed.
In either case, the referenced Validator
is expected to be reusable
and thread-safe. If you used a reference, then that reference will most likely
always point to the same instance. If you use a class, then an instance will be
created and reused.Constructor and Description |
---|
CustomValidatorOperation() |
Modifier and Type | Method and Description |
---|---|
protected ValidationContext |
createContext(ValidationOptions options,
MuleEvent muleEvent,
ValidationExtension config) |
void |
customValidator(ObjectSource<Validator> source,
ValidationOptions options,
MuleEvent event,
ValidationExtension config) |
protected void |
logSuccessfulValidation(Validator validator,
MuleEvent event) |
protected Locale |
parseLocale(String locale) |
protected void |
validateWith(Validator validator,
ValidationContext validationContext,
MuleEvent event) |
protected final Logger logger
@Operation public void customValidator(@ParameterGroup ObjectSource<Validator> source, @ParameterGroup ValidationOptions options, MuleEvent event, @UseConfig ValidationExtension config) throws Exception
Exception
protected void logSuccessfulValidation(Validator validator, MuleEvent event)
protected void validateWith(Validator validator, ValidationContext validationContext, MuleEvent event) throws Exception
Exception
protected ValidationContext createContext(ValidationOptions options, MuleEvent muleEvent, ValidationExtension config)
Copyright © 2003–2016 MuleSoft, Inc.. All rights reserved.