public class IntegrationUtils extends Object
Modifier and Type | Field and Description |
---|---|
static boolean |
fatalWhenNoBeanFactory
Should be set to TRUE on CI plans and framework developer systems.
|
static String |
INTEGRATION_CONVERSION_SERVICE_BEAN_NAME |
static String |
INTEGRATION_MESSAGE_BUILDER_FACTORY_BEAN_NAME |
Constructor and Description |
---|
IntegrationUtils() |
Modifier and Type | Method and Description |
---|---|
static String |
bytesToString(byte[] bytes,
String encoding)
Utility method for null-safe conversion from byte[] to String
|
static ConversionService |
getConversionService(BeanFactory beanFactory) |
static MessageBuilderFactory |
getMessageBuilderFactory(BeanFactory beanFactory)
Returns the context-wide `messageBuilderFactory` bean from the beanFactory,
or a
DefaultMessageBuilderFactory if not found or the beanFactory is null. |
static byte[] |
stringToBytes(String value,
String encoding)
Utility method for null-safe conversion from String to byte[]
|
public static final String INTEGRATION_CONVERSION_SERVICE_BEAN_NAME
public static final String INTEGRATION_MESSAGE_BUILDER_FACTORY_BEAN_NAME
public static final boolean fatalWhenNoBeanFactory
public static ConversionService getConversionService(BeanFactory beanFactory)
beanFactory
- BeanFactory for lookup, must not be null.ConversionService
bean whose name is "integrationConversionService" if available.public static MessageBuilderFactory getMessageBuilderFactory(BeanFactory beanFactory)
DefaultMessageBuilderFactory
if not found or the beanFactory is null.beanFactory
- The bean factory.public static byte[] stringToBytes(String value, String encoding)
value
- the String to be convertedencoding
- the encodingIllegalArgumentException
- if the encoding is not supportedpublic static String bytesToString(byte[] bytes, String encoding)
bytes
- the byte[] to be convertedencoding
- the encodingIllegalArgumentException
- if the encoding is not supported