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 constructor
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 static String |
ERROR_GROUP |
protected static org.slf4j.Logger |
LOGGER |
protected MuleContext |
muleContext |
| Constructor and Description |
|---|
CustomValidatorOperation() |
| Modifier and Type | Method and Description |
|---|---|
protected ValidationContext |
createContext(ValidationOptions options,
Event muleEvent,
ValidationExtension config) |
void |
customValidator(ObjectSource<Validator> source,
ValidationOptions options,
Event event,
ValidationExtension config) |
protected void |
logSuccessfulValidation(Validator validator,
Event event) |
protected Locale |
parseLocale(String locale) |
protected void |
validateWith(Validator validator,
ValidationContext validationContext,
Event event) |
protected static final String ERROR_GROUP
protected static final org.slf4j.Logger LOGGER
@Inject protected MuleContext muleContext
public void customValidator(@ParameterGroup(value="Validator")
ObjectSource<Validator> source,
@ParameterGroup(value="Error options")
ValidationOptions options,
Event event,
@UseConfig
ValidationExtension config)
throws Exception
Exceptionprotected void validateWith(Validator validator, ValidationContext validationContext, Event event) throws Exception
Exceptionprotected ValidationContext createContext(ValidationOptions options, Event muleEvent, ValidationExtension config)
Copyright © 2003–2016 MuleSoft, Inc.. All rights reserved.