Class SimpleToAvroTransformer
java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.transformer.AbstractTransformer
org.springframework.integration.transformer.SimpleToAvroTransformer
- All Implemented Interfaces:
Aware
,BeanFactoryAware
,BeanNameAware
,InitializingBean
,ApplicationContextAware
,ExpressionCapable
,NamedComponent
,GenericTransformer<Message<?>,Message<?>>
,Transformer
public class SimpleToAvroTransformer extends AbstractTransformer
An Apache Avro transformer for generated
SpecificRecord
objects.- Since:
- 5.2
- Author:
- Gary Russell
-
Field Summary
Fields inherited from class org.springframework.integration.context.IntegrationObjectSupport
EXPRESSION_PARSER, logger
-
Constructor Summary
Constructors Constructor Description SimpleToAvroTransformer()
-
Method Summary
Modifier and Type Method Description protected Object
doTransform(Message<?> message)
Subclasses must implement this method to provide the transformation logic.protected void
onInit()
Subclasses may implement this for initialization logic.void
setTypeExpression(Expression expression)
Set the expression to evaluate against the message to determine the value for theAvroHeaders.TYPE
header.void
setTypeExpressionString(String expression)
Set the expression to evaluate against the message to determine the value for theAvroHeaders.TYPE
header.SimpleToAvroTransformer
typeExpression(String expression)
Set the expression to evaluate against the message to determine the value for theAvroHeaders.TYPE
header.SimpleToAvroTransformer
typeExpression(Expression expression)
Set the expression to evaluate against the message to determine the value for theAvroHeaders.TYPE
header.Methods inherited from class org.springframework.integration.transformer.AbstractTransformer
transform
Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport
afterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentName, getComponentType, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toString
-
Constructor Details
-
SimpleToAvroTransformer
public SimpleToAvroTransformer()
-
-
Method Details
-
typeExpression
Set the expression to evaluate against the message to determine the value for theAvroHeaders.TYPE
header.- Parameters:
expression
- the expression.- Returns:
- the transformer
-
typeExpression
Set the expression to evaluate against the message to determine the value for theAvroHeaders.TYPE
header.- Parameters:
expression
- the expression.- Returns:
- the transformer
-
setTypeExpression
Set the expression to evaluate against the message to determine the value for theAvroHeaders.TYPE
header.- Parameters:
expression
- the expression.
-
setTypeExpressionString
Set the expression to evaluate against the message to determine the value for theAvroHeaders.TYPE
header.- Parameters:
expression
- the expression.
-
onInit
protected void onInit()Description copied from class:IntegrationObjectSupport
Subclasses may implement this for initialization logic.- Overrides:
onInit
in classIntegrationObjectSupport
-
doTransform
Description copied from class:AbstractTransformer
Subclasses must implement this method to provide the transformation logic. If the return value is itself a Message, it will be used as the result. Otherwise, any non-null return value will be used as the payload of the result Message.- Specified by:
doTransform
in classAbstractTransformer
- Parameters:
message
- The message.- Returns:
- The result of the transformation.
-