@ImplementationOf(value=ValidationExtension.class) 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 Construct
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.Modifier and Type | Field and Description |
---|---|
protected ValidationExtension |
config |
protected Logger |
logger |
Constructor and Description |
---|
CustomValidatorOperation(ValidationExtension config) |
Modifier and Type | Method and Description |
---|---|
protected ValidationContext |
createContext(ValidationOptions options,
MuleEvent muleEvent) |
void |
customValidator(ObjectSource<Validator> source,
ValidationOptions options,
MuleEvent event) |
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
protected final ValidationExtension config
public CustomValidatorOperation(ValidationExtension config)
@Operation public void customValidator(@ParameterGroup ObjectSource<Validator> source, @ParameterGroup ValidationOptions options, MuleEvent event) 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)
Copyright © 2003–2015 MuleSoft, Inc.. All rights reserved.