Package org.apache.camel.spi
Class Validator
java.lang.Object
org.apache.camel.support.service.BaseService
org.apache.camel.support.service.ServiceSupport
org.apache.camel.spi.Validator
- All Implemented Interfaces:
AutoCloseable
,CamelContextAware
,Service
,ShutdownableService
,HasCamelContext
,StatefulService
,SuspendableService
Validator performs message content validation according to the
declared data type.
applies Validator if input/output type is
declared on a route with validation enabled.
invalid reference
org.apache.camel.processor.ContractAdvice
-
Field Summary
Fields inherited from class org.apache.camel.support.service.BaseService
BUILT, FAILED, INITIALIZED, INITIALIZING, lock, NEW, SHUTDOWN, SHUTTING_DOWN, STARTED, STARTING, status, STOPPED, STOPPING, SUSPENDED, SUSPENDING
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the camel context.getType()
Get 'from' data type.void
setCamelContext
(CamelContext context) Injects theCamelContext
Set data type.toString()
abstract void
Perform data validation with specified type.Methods inherited from class org.apache.camel.support.service.BaseService
build, doBuild, doFail, doInit, doLifecycleChange, doResume, doShutdown, doStart, doStop, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.camel.ShutdownableService
shutdown
Methods inherited from interface org.apache.camel.StatefulService
getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspending
Methods inherited from interface org.apache.camel.SuspendableService
isSuspended, resume, suspend
-
Constructor Details
-
Validator
public Validator()
-
-
Method Details
-
validate
Perform data validation with specified type.- Parameters:
message
- message to apply validationtype
- the data type- Throws:
ValidationException
- thrown if any validation error is detected
-
getType
Get 'from' data type. -
setType
Set data type.- Parameters:
type
- data type
-
getCamelContext
Description copied from interface:HasCamelContext
Returns the camel context.- Specified by:
getCamelContext
in interfaceHasCamelContext
- Returns:
- the camel context.
-
setCamelContext
Description copied from interface:CamelContextAware
Injects theCamelContext
- Specified by:
setCamelContext
in interfaceCamelContextAware
- Parameters:
context
- the Camel context
-
toString
-