public abstract class Validator extends ServiceSupport implements CamelContextAware
org.apache.camel.processor.ContractAdvice applies Validator if input/output type is declared on
a route with validation enabled.org.apache.camel.processor.ContractAdvice}
{@link org.apache.camel.model.InputTypeDefinition} {@link org.apache.camel.model.OutputTypeDefinition}BUILDED, FAILED, INITIALIZED, lock, log, NEW, SHUTDOWN, SHUTTINGDOWN, STARTED, STARTING, status, STOPPED, STOPPING, SUSPENDED, SUSPENDING| Constructor and Description |
|---|
Validator() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doStart()
Implementations override this method to support customized start/stop.
|
protected void |
doStop()
Implementations override this method to support customized start/stop.
|
CamelContext |
getCamelContext()
Get the
CamelContext |
DataType |
getType()
Get 'from' data type.
|
void |
setCamelContext(CamelContext context)
Injects the
CamelContext |
Validator |
setType(String type)
Set data type.
|
String |
toString() |
abstract void |
validate(Message message,
DataType type)
Perform data validation with specified type.
|
build, doBuild, doInit, doResume, doShutdown, doSuspend, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspendclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waittrySetCamelContextpublic Validator()
public abstract void validate(Message message, DataType type) throws ValidationException
message - message to apply validationtype - the data typeValidationException - thrown if any validation error is detectedpublic CamelContext getCamelContext()
CamelContextAwareCamelContextgetCamelContext in interface CamelContextAwarepublic void setCamelContext(CamelContext context)
CamelContextAwareCamelContextsetCamelContext in interface CamelContextAwarecontext - the Camel contextprotected void doStart() throws Exception
ServiceSupportServiceSupport.doStop() for more details.doStart in class ServiceSupportExceptionServiceSupport.doStop()protected void doStop() throws Exception
ServiceSupportServiceSupport.doStop() method when
the service is being stopped. This method will also be invoked
if the service is still in uninitialized state (eg has not
been started). The method is always called to allow the service
to do custom logic when the service is being stopped, such as when
CamelContext is shutting down.doStop in class ServiceSupportExceptionServiceSupport.doStart()Apache Camel