public abstract class IntegrationNamespaceUtils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
AUTO_STARTUP |
static String |
EXPRESSION_ATTRIBUTE |
static String |
METHOD_ATTRIBUTE |
static String |
ORDER |
static String |
PHASE |
static String |
REF_ATTRIBUTE |
static String |
REQUEST_HANDLER_ADVICE_CHAIN |
Constructor and Description |
---|
IntegrationNamespaceUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
checkAndConfigureFixedSubscriberChannel(Element element,
ParserContext parserContext,
String channelName,
String handlerBeanName) |
static ManagedList |
configureAdviceChain(Element adviceChainElement,
Element txElement,
BeanDefinition parentBeanDefinition,
ParserContext parserContext) |
static void |
configureAndSetAdviceChainIfPresent(Element adviceChainElement,
Element txElement,
BeanDefinition parentBeanDefinition,
ParserContext parserContext) |
static void |
configureAndSetAdviceChainIfPresent(Element adviceChainElement,
Element txElement,
BeanDefinition parentBeanDefinition,
ParserContext parserContext,
String propertyName) |
static void |
configureHeaderMapper(Element element,
BeanDefinitionBuilder rootBuilder,
ParserContext parserContext,
Class<?> headerMapperClass,
String replyHeaderValue)
Utility method to configure a HeaderMapper for Inbound and Outbound channel adapters/gateway.
|
static void |
configurePollerMetadata(Element pollerElement,
BeanDefinitionBuilder targetBuilder,
ParserContext parserContext)
Parse a "poller" element to provide a reference for the target BeanDefinitionBuilder.
|
static BeanDefinition |
configureTransactionAttributes(Element txElement)
Parse a "transactional" element and configure a
TransactionInterceptor
with "transactionManager" and other "transactionDefinition" properties. |
static BeanDefinition |
configureTransactionDefinition(Element txElement)
Parse attributes of "transactional" element and configure a
DefaultTransactionAttribute
with provided "transactionDefinition" properties. |
static String |
createDirectChannel(Element element,
ParserContext parserContext) |
static String |
createElementDescription(Element element)
Provides a user friendly description of an element based on its node name and, if available, its "id" attribute
value.
|
static BeanDefinition |
createExpressionDefIfAttributeDefined(String expressionElementName,
Element element) |
static BeanDefinition |
createExpressionDefinitionFromValueOrExpression(String valueElementName,
String expressionElementName,
ParserContext parserContext,
Element element,
boolean oneRequired) |
static String[] |
generateAlias(Element element) |
static String |
getTextFromAttributeOrNestedElement(Element element,
String name,
ParserContext parserContext)
Get a text value from a named attribute if it exists, otherwise check for a nested element of the same name.
|
static BeanComponentDefinition |
parseInnerHandlerDefinition(Element element,
ParserContext parserContext) |
static void |
setReferenceIfAttributeDefined(BeanDefinitionBuilder builder,
Element element,
String attributeName)
Configures the provided bean definition builder with a property reference to a bean.
|
static void |
setReferenceIfAttributeDefined(BeanDefinitionBuilder builder,
Element element,
String attributeName,
boolean emptyStringAllowed) |
static void |
setReferenceIfAttributeDefined(BeanDefinitionBuilder builder,
Element element,
String attributeName,
String propertyName)
Configures the provided bean definition builder with a property reference to a bean.
|
static void |
setReferenceIfAttributeDefined(BeanDefinitionBuilder builder,
Element element,
String attributeName,
String propertyName,
boolean emptyStringAllowed) |
static void |
setValueIfAttributeDefined(BeanDefinitionBuilder builder,
Element element,
String attributeName)
Configures the provided bean definition builder with a property value corresponding to the attribute whose name
is provided if that attribute is defined in the given element.
|
static void |
setValueIfAttributeDefined(BeanDefinitionBuilder builder,
Element element,
String attributeName,
boolean emptyStringAllowed)
Configures the provided bean definition builder with a property value corresponding to the attribute whose name
is provided if that attribute is defined in the given element.
|
static void |
setValueIfAttributeDefined(BeanDefinitionBuilder builder,
Element element,
String attributeName,
String propertyName)
Configures the provided bean definition builder with a property value corresponding to the attribute whose name
is provided if that attribute is defined in the given element.
|
static void |
setValueIfAttributeDefined(BeanDefinitionBuilder builder,
Element element,
String attributeName,
String propertyName,
boolean emptyStringAllowed)
Configures the provided bean definition builder with a property value corresponding to the attribute whose name
is provided if that attribute is defined in the given element.
|
public static final String REF_ATTRIBUTE
public static final String METHOD_ATTRIBUTE
public static final String ORDER
public static final String EXPRESSION_ATTRIBUTE
public static final String REQUEST_HANDLER_ADVICE_CHAIN
public static final String AUTO_STARTUP
public static final String PHASE
public static void setValueIfAttributeDefined(BeanDefinitionBuilder builder, Element element, String attributeName, String propertyName)
builder
- the bean definition builder to be configuredelement
- the XML element where the attribute should be definedattributeName
- the name of the attribute whose value will be used to populate the propertypropertyName
- the name of the property to be populatedpublic static void setValueIfAttributeDefined(BeanDefinitionBuilder builder, Element element, String attributeName)
The property name will be the camel-case equivalent of the lower case hyphen separated attribute (e.g. the "foo-bar" attribute would match the "fooBar" property).
builder
- the bean definition builder to be configuredelement
- - the XML element where the attribute should be definedattributeName
- - the name of the attribute whose value will be set on the propertyConventions.attributeNameToPropertyName(String)
public static void setValueIfAttributeDefined(BeanDefinitionBuilder builder, Element element, String attributeName, String propertyName, boolean emptyStringAllowed)
builder
- the bean definition builder to be configuredelement
- the XML element where the attribute should be definedattributeName
- the name of the attribute whose value will be used to populate the propertypropertyName
- the name of the property to be populatedemptyStringAllowed
- - if true, the value is set, even if an empty String (""); if false, an empty
String is treated as if the attribute wasn't provided.public static void setValueIfAttributeDefined(BeanDefinitionBuilder builder, Element element, String attributeName, boolean emptyStringAllowed)
The property name will be the camel-case equivalent of the lower case hyphen separated attribute (e.g. the "foo-bar" attribute would match the "fooBar" property).
builder
- the bean definition builder to be configuredelement
- - the XML element where the attribute should be definedattributeName
- - the name of the attribute whose value will be set on the propertyemptyStringAllowed
- - if true, the value is set, even if an empty String (""); if false, an empty
String is treated as if the attribute wasn't provided.Conventions.attributeNameToPropertyName(String)
public static void setReferenceIfAttributeDefined(BeanDefinitionBuilder builder, Element element, String attributeName, String propertyName)
builder
- the bean definition builder to be configuredelement
- the XML element where the attribute should be definedattributeName
- the name of the attribute whose value will be used as a bean reference to populate the
propertypropertyName
- the name of the property to be populatedpublic static void setReferenceIfAttributeDefined(BeanDefinitionBuilder builder, Element element, String attributeName, String propertyName, boolean emptyStringAllowed)
public static void setReferenceIfAttributeDefined(BeanDefinitionBuilder builder, Element element, String attributeName)
The property name will be the camel-case equivalent of the lower case hyphen separated attribute (e.g. the "foo-bar" attribute would match the "fooBar" property).
builder
- the bean definition builder to be configuredelement
- - the XML element where the attribute should be definedattributeName
- - the name of the attribute whose value will be used as a bean reference to populate the
propertyConventions.attributeNameToPropertyName(String)
,
Conventions.attributeNameToPropertyName(String)
public static void setReferenceIfAttributeDefined(BeanDefinitionBuilder builder, Element element, String attributeName, boolean emptyStringAllowed)
public static String createElementDescription(Element element)
element
- The element.public static void configurePollerMetadata(Element pollerElement, BeanDefinitionBuilder targetBuilder, ParserContext parserContext)
pollerElement
- the "poller" element to parsetargetBuilder
- the builder that expects the "trigger" propertyparserContext
- the parserContext for the target builderpublic static String getTextFromAttributeOrNestedElement(Element element, String name, ParserContext parserContext)
element
- a DOM nodename
- the name of the property (attribute or child element)parserContext
- the current contextpublic static BeanComponentDefinition parseInnerHandlerDefinition(Element element, ParserContext parserContext)
public static void configureHeaderMapper(Element element, BeanDefinitionBuilder rootBuilder, ParserContext parserContext, Class<?> headerMapperClass, String replyHeaderValue)
element
- The element.rootBuilder
- The root builder.parserContext
- The parser context.headerMapperClass
- The header mapper class.replyHeaderValue
- The reply header value.public static BeanDefinition configureTransactionAttributes(Element txElement)
TransactionInterceptor
with "transactionManager" and other "transactionDefinition" properties.
For example, this advisor will be applied on the Polling Task proxy.txElement
- The transactional element.AbstractPollingEndpoint
public static BeanDefinition configureTransactionDefinition(Element txElement)
DefaultTransactionAttribute
with provided "transactionDefinition" properties.txElement
- The transactional element.public static void configureAndSetAdviceChainIfPresent(Element adviceChainElement, Element txElement, BeanDefinition parentBeanDefinition, ParserContext parserContext)
public static void configureAndSetAdviceChainIfPresent(Element adviceChainElement, Element txElement, BeanDefinition parentBeanDefinition, ParserContext parserContext, String propertyName)
public static ManagedList configureAdviceChain(Element adviceChainElement, Element txElement, BeanDefinition parentBeanDefinition, ParserContext parserContext)
public static BeanDefinition createExpressionDefinitionFromValueOrExpression(String valueElementName, String expressionElementName, ParserContext parserContext, Element element, boolean oneRequired)
public static BeanDefinition createExpressionDefIfAttributeDefined(String expressionElementName, Element element)
public static String createDirectChannel(Element element, ParserContext parserContext)
public static void checkAndConfigureFixedSubscriberChannel(Element element, ParserContext parserContext, String channelName, String handlerBeanName)