Package org.apache.camel.spi
Class Transformer
java.lang.Object
org.apache.camel.support.service.BaseService
org.apache.camel.support.service.ServiceSupport
org.apache.camel.spi.Transformer
- All Implemented Interfaces:
AutoCloseable
,CamelContextAware
,Service
,ShutdownableService
,HasCamelContext
,StatefulService
,SuspendableService
Transformer performs message transformation according to the
declared data type.
looks for a required Transformer and apply if
input/output type declared on a route is different from current message type.
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the camel context.getFrom()
Get 'from' data type.getName()
Get the transformer name that represents the supported data type model.getTo()
Get 'to' data type.void
setCamelContext
(CamelContext context) Injects theCamelContext
Set 'from' data type.Set the name for this transformer.Set the scheme and/or name for this transformer.Set 'to' data type.toString()
abstract void
Perform data transformation with specified from/to type.Methods inherited from class org.apache.camel.support.service.BaseService
build, doBuild, doFail, doInit, doLifecycleChange, doResume, doShutdown, doStart, doStop, doSuspend, fail, getInternalLock, 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
-
Transformer
public Transformer() -
Transformer
-
-
Method Details
-
transform
Perform data transformation with specified from/to type.- Parameters:
message
- message to apply transformationfrom
- 'from' data typeto
- 'to' data type- Throws:
Exception
-
getName
Get the transformer name that represents the supported data type model. -
getFrom
Get 'from' data type. -
getTo
Get 'to' data type. -
setName
Set the name for this transformer. Usually a combination of scheme and name. -
setName
Set the scheme and/or name for this transformer. When using only a scheme, the transformer applies to all transformations with that scheme.- Parameters:
scheme
- supported data type schemename
- transformer name
-
setFrom
Set 'from' data type. -
setTo
Set 'to' 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
-