Class PayloadDeserializingTransformer
java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.transformer.AbstractTransformer
org.springframework.integration.transformer.AbstractPayloadTransformer<T,U>
org.springframework.integration.transformer.PayloadTypeConvertingTransformer<byte[],Object>
org.springframework.integration.transformer.PayloadDeserializingTransformer
- All Implemented Interfaces:
Aware,BeanFactoryAware,BeanNameAware,InitializingBean,ApplicationContextAware,ComponentSourceAware,ExpressionCapable,GenericTransformer<Message<?>,,Message<?>> NamedComponent,Transformer
public class PayloadDeserializingTransformer
extends PayloadTypeConvertingTransformer<byte[],Object>
Transformer that deserializes the inbound byte array payload to an object by delegating
to a Converter<byte[], Object>. Default delegate is a
AllowListDeserializingConverter using Java serialization.
The byte array payload must be a result of equivalent serialization.
- Since:
- 1.0.1
- Author:
- Mark Fisher, Gary Russell, Artem Bilan, Glenn Renfro
-
Field Summary
Fields inherited from class org.springframework.integration.context.IntegrationObjectSupport
EXPRESSION_PARSER, logger -
Constructor Summary
ConstructorsConstructorDescriptionInstantiate based on theAllowListDeserializingConverterwith theDefaultDeserializer. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAllowedPatterns(String... patterns) When using aAllowListDeserializingConverter(the default) add patterns for packages/classes that are allowed to be deserialized, in addition to the existing ones (by default theAllowListDeserializingConverter.DEFAULT_ALLOWED_PATTERNS).voidsetAllowedPatterns(String... patterns) When using aAllowListDeserializingConverter(the default) set patterns for packages/classes that are allowed to be deserialized.voidsetDeserializer(Deserializer<Object> deserializer) Set aDeserializerto be wrapped into a newAllowListDeserializingConverter.Methods inherited from class org.springframework.integration.transformer.PayloadTypeConvertingTransformer
doSetConverter, getConverter, onInit, setConverter, transformPayloadMethods inherited from class org.springframework.integration.transformer.AbstractPayloadTransformer
doTransformMethods inherited from class org.springframework.integration.transformer.AbstractTransformer
transformMethods inherited from class org.springframework.integration.context.IntegrationObjectSupport
afterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentDescription, getComponentName, getComponentSource, getConversionService, getExpression, getIntegrationProperties, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentDescription, setComponentName, setComponentSource, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toString
-
Constructor Details
-
PayloadDeserializingTransformer
public PayloadDeserializingTransformer()Instantiate based on theAllowListDeserializingConverterwith theDefaultDeserializer.
-
-
Method Details
-
setDeserializer
Set aDeserializerto be wrapped into a newAllowListDeserializingConverter. The allowed patterns of the currentAllowListDeserializingConverter, if any, are carried over to the new one.- Parameters:
deserializer- the deserializer to use.
-
setAllowedPatterns
When using aAllowListDeserializingConverter(the default) set patterns for packages/classes that are allowed to be deserialized. A class can be fully qualified, or a wildcard '*' is allowed at the beginning or end of the class name. Examples:com.example.*,*.MyClass. Replaces all the existing patterns, including theAllowListDeserializingConverter.DEFAULT_ALLOWED_PATTERNS. UseaddAllowedPatterns(String...)to keep the defaults.- Parameters:
patterns- the patterns.- Since:
- 5.4
-
addAllowedPatterns
When using aAllowListDeserializingConverter(the default) add patterns for packages/classes that are allowed to be deserialized, in addition to the existing ones (by default theAllowListDeserializingConverter.DEFAULT_ALLOWED_PATTERNS).- Parameters:
patterns- the patterns to add.- Since:
- 7.2
- See Also:
-
getComponentType
- Specified by:
getComponentTypein interfaceNamedComponent- Overrides:
getComponentTypein classPayloadTypeConvertingTransformer<byte[],Object>
-