@@ -1405,7 +1405,7 @@ public B enrichHeaders(Consumer<HeaderEnricherSpec> headerEnricherConfigurer) {
14051405 * @return the current {@link BaseIntegrationFlowDefinition}.
14061406 */
14071407 public B split () {
1408- return split (( Consumer < SplitterEndpointSpec < DefaultMessageSplitter >>) null );
1408+ return splitWith (( splitterSpec ) -> { } );
14091409 }
14101410
14111411 /**
@@ -1420,21 +1420,47 @@ public B split() {
14201420 * @param endpointConfigurer the {@link Consumer} to provide integration endpoint options
14211421 * and for {@link DefaultMessageSplitter}.
14221422 * @return the current {@link BaseIntegrationFlowDefinition}.
1423+ * @deprecated since 6.2 in favor of {@link #splitWith(Consumer)}.
14231424 * @see SplitterEndpointSpec
14241425 */
1426+ @ Deprecated (since = "6.2" , forRemoval = true )
1427+ @ SuppressWarnings ("removal" )
14251428 public B split (@ Nullable Consumer <SplitterEndpointSpec <DefaultMessageSplitter >> endpointConfigurer ) {
14261429 return split (new DefaultMessageSplitter (), endpointConfigurer );
14271430 }
14281431
1432+
1433+ /**
1434+ * Populate the splitter with provided options to the current integration flow position:
1435+ * <pre class="code">
1436+ * {@code
1437+ * .splitWith(s -> s.applySequence(false).delimiters(","))
1438+ * }
1439+ * </pre>
1440+ * or with the refenrence to POJO service method call:
1441+ * <pre class="code">
1442+ * {@code
1443+ * .splitWith(s -> s.ref("someService").method("someMethod"))
1444+ * }
1445+ * </pre>
1446+ * @param splitterConfigurer the {@link Consumer} to provide options splitter endpoint.
1447+ * @return the current {@link BaseIntegrationFlowDefinition}.
1448+ * @since 6.2
1449+ * @see SplitterSpec
1450+ */
1451+ public B splitWith (Consumer <SplitterSpec > splitterConfigurer ) {
1452+ return register (new SplitterSpec (), splitterConfigurer );
1453+ }
1454+
14291455 /**
14301456 * Populate the {@link ExpressionEvaluatingSplitter} with provided SpEL expression.
14311457 * @param expression the splitter SpEL expression.
14321458 * and for {@link ExpressionEvaluatingSplitter}.
14331459 * @return the current {@link BaseIntegrationFlowDefinition}.
1434- * @see SplitterEndpointSpec
1460+ * @see SplitterSpec
14351461 */
14361462 public B split (String expression ) {
1437- return split ( expression , ( Consumer < SplitterEndpointSpec < ExpressionEvaluatingSplitter >>) null );
1463+ return splitWith (( splitterSpec ) -> splitterSpec . expression ( expression ) );
14381464 }
14391465
14401466 /**
@@ -1443,8 +1469,11 @@ public B split(String expression) {
14431469 * @param endpointConfigurer the {@link Consumer} to provide integration endpoint options
14441470 * and for {@link ExpressionEvaluatingSplitter}.
14451471 * @return the current {@link BaseIntegrationFlowDefinition}.
1472+ * @deprecated since 6.2 in favor of {@link #splitWith(Consumer)}.
14461473 * @see SplitterEndpointSpec
14471474 */
1475+ @ Deprecated (since = "6.2" , forRemoval = true )
1476+ @ SuppressWarnings ("removal" )
14481477 public B split (String expression ,
14491478 @ Nullable Consumer <SplitterEndpointSpec <ExpressionEvaluatingSplitter >> endpointConfigurer ) {
14501479
@@ -1472,7 +1501,7 @@ public B split(Object service) {
14721501 * @see MethodInvokingSplitter
14731502 */
14741503 public B split (Object service , @ Nullable String methodName ) {
1475- return split ( service , methodName , null );
1504+ return splitWith (( splitterSpec ) -> splitterSpec . ref ( service ). method ( methodName ) );
14761505 }
14771506
14781507 /**
@@ -1484,9 +1513,12 @@ public B split(Object service, @Nullable String methodName) {
14841513 * @param endpointConfigurer the {@link Consumer} to provide integration endpoint options
14851514 * and for {@link MethodInvokingSplitter}.
14861515 * @return the current {@link BaseIntegrationFlowDefinition}.
1516+ * @deprecated since 6.2 in favor of {@link #splitWith(Consumer)}.
14871517 * @see SplitterEndpointSpec
14881518 * @see MethodInvokingSplitter
14891519 */
1520+ @ Deprecated (since = "6.2" , forRemoval = true )
1521+ @ SuppressWarnings ("removal" )
14901522 public B split (Object service , @ Nullable String methodName ,
14911523 @ Nullable Consumer <SplitterEndpointSpec <MethodInvokingSplitter >> endpointConfigurer ) {
14921524
@@ -1508,7 +1540,7 @@ public B split(Object service, @Nullable String methodName,
15081540 * @return the current {@link BaseIntegrationFlowDefinition}.
15091541 */
15101542 public B split (String beanName , @ Nullable String methodName ) {
1511- return split ( beanName , methodName , null );
1543+ return splitWith (( splitterSpec ) -> splitterSpec . refName ( beanName ). method ( methodName ) );
15121544 }
15131545
15141546 /**
@@ -1520,8 +1552,11 @@ public B split(String beanName, @Nullable String methodName) {
15201552 * @param endpointConfigurer the {@link Consumer} to provide integration endpoint options
15211553 * and for {@link MethodInvokingSplitter}.
15221554 * @return the current {@link BaseIntegrationFlowDefinition}.
1555+ * @deprecated since 6.2 in favor of {@link #splitWith(Consumer)}.
15231556 * @see SplitterEndpointSpec
15241557 */
1558+ @ Deprecated (since = "6.2" , forRemoval = true )
1559+ @ SuppressWarnings ("removal" )
15251560 public B split (String beanName , @ Nullable String methodName ,
15261561 @ Nullable Consumer <SplitterEndpointSpec <MethodInvokingSplitter >> endpointConfigurer ) {
15271562
@@ -1540,10 +1575,10 @@ public B split(String beanName, @Nullable String methodName,
15401575 * </pre>
15411576 * @param messageProcessorSpec the splitter {@link MessageProcessorSpec}.
15421577 * @return the current {@link BaseIntegrationFlowDefinition}.
1543- * @see SplitterEndpointSpec
1578+ * @see SplitterSpec
15441579 */
15451580 public B split (MessageProcessorSpec <?> messageProcessorSpec ) {
1546- return split ( messageProcessorSpec , ( Consumer < SplitterEndpointSpec < MethodInvokingSplitter >>) null );
1581+ return splitWith (( splitterSpec ) -> splitterSpec . ref ( messageProcessorSpec ) );
15471582 }
15481583
15491584 /**
@@ -1561,8 +1596,11 @@ public B split(MessageProcessorSpec<?> messageProcessorSpec) {
15611596 * @param endpointConfigurer the {@link Consumer} to provide integration endpoint options
15621597 * and for {@link MethodInvokingSplitter}.
15631598 * @return the current {@link BaseIntegrationFlowDefinition}.
1599+ * @deprecated since 6.2 in favor of {@link #splitWith(Consumer)}.
15641600 * @see SplitterEndpointSpec
15651601 */
1602+ @ Deprecated (since = "6.2" , forRemoval = true )
1603+ @ SuppressWarnings ("removal" )
15661604 public B split (MessageProcessorSpec <?> messageProcessorSpec ,
15671605 @ Nullable Consumer <SplitterEndpointSpec <MethodInvokingSplitter >> endpointConfigurer ) {
15681606
@@ -1595,7 +1633,7 @@ public B split(MessageProcessorSpec<?> messageProcessorSpec,
15951633 * @see LambdaMessageProcessor
15961634 */
15971635 public <P > B split (Class <P > expectedType , Function <P , ?> splitter ) {
1598- return split ( expectedType , splitter , null );
1636+ return splitWith (( splitterSpec ) -> splitterSpec . function ( splitter ). expectedType ( expectedType ) );
15991637 }
16001638
16011639 /**
@@ -1621,9 +1659,12 @@ public <P> B split(Class<P> expectedType, Function<P, ?> splitter) {
16211659 * @param endpointConfigurer the {@link Consumer} to provide integration endpoint options.
16221660 * @param <P> the payload type or {@code Message.class}.
16231661 * @return the current {@link BaseIntegrationFlowDefinition}.
1662+ * @deprecated since 6.2 in favor of {@link #splitWith(Consumer)}.
16241663 * @see LambdaMessageProcessor
16251664 * @see SplitterEndpointSpec
16261665 */
1666+ @ Deprecated (since = "6.2" , forRemoval = true )
1667+ @ SuppressWarnings ("removal" )
16271668 public <P > B split (@ Nullable Class <P > expectedType , Function <P , ?> splitter ,
16281669 @ Nullable Consumer <SplitterEndpointSpec <MethodInvokingSplitter >> endpointConfigurer ) {
16291670
@@ -1640,10 +1681,10 @@ public <P> B split(@Nullable Class<P> expectedType, Function<P, ?> splitter,
16401681 * @param splitterMessageHandlerSpec the {@link MessageHandlerSpec} to populate.
16411682 * @param <S> the {@link AbstractMessageSplitter}
16421683 * @return the current {@link BaseIntegrationFlowDefinition}.
1643- * @see SplitterEndpointSpec
1684+ * @see SplitterSpec
16441685 */
16451686 public <S extends AbstractMessageSplitter > B split (MessageHandlerSpec <?, S > splitterMessageHandlerSpec ) {
1646- return split ( splitterMessageHandlerSpec , ( Consumer < SplitterEndpointSpec < S >>) null );
1687+ return splitWith (( splitterSpec ) -> splitterSpec . ref ( splitterMessageHandlerSpec ) );
16471688 }
16481689
16491690 /**
@@ -1653,8 +1694,11 @@ public <S extends AbstractMessageSplitter> B split(MessageHandlerSpec<?, S> spli
16531694 * @param endpointConfigurer the {@link Consumer} to provide integration endpoint options.
16541695 * @param <S> the {@link AbstractMessageSplitter}
16551696 * @return the current {@link BaseIntegrationFlowDefinition}.
1697+ * @deprecated since 6.2 in favor of {@link #splitWith(Consumer)}.
16561698 * @see SplitterEndpointSpec
16571699 */
1700+ @ Deprecated (since = "6.2" , forRemoval = true )
1701+ @ SuppressWarnings ("removal" )
16581702 public <S extends AbstractMessageSplitter > B split (MessageHandlerSpec <?, S > splitterMessageHandlerSpec ,
16591703 @ Nullable Consumer <SplitterEndpointSpec <S >> endpointConfigurer ) {
16601704
@@ -1667,10 +1711,10 @@ public <S extends AbstractMessageSplitter> B split(MessageHandlerSpec<?, S> spli
16671711 * flow position.
16681712 * @param splitter the {@link AbstractMessageSplitter} to populate.
16691713 * @return the current {@link BaseIntegrationFlowDefinition}.
1670- * @see SplitterEndpointSpec
1714+ * @see SplitterSpec
16711715 */
16721716 public B split (AbstractMessageSplitter splitter ) {
1673- return split ( splitter , ( Consumer < SplitterEndpointSpec < AbstractMessageSplitter >>) null );
1717+ return splitWith (( splitterSpec ) -> splitterSpec . ref ( splitter ) );
16741718 }
16751719
16761720 /**
@@ -1680,8 +1724,11 @@ public B split(AbstractMessageSplitter splitter) {
16801724 * @param endpointConfigurer the {@link Consumer} to provide integration endpoint options.
16811725 * @param <S> the {@link AbstractMessageSplitter}
16821726 * @return the current {@link BaseIntegrationFlowDefinition}.
1727+ * @deprecated since 6.2 in favor of {@link #splitWith(Consumer)}.
16831728 * @see SplitterEndpointSpec
16841729 */
1730+ @ Deprecated (since = "6.2" , forRemoval = true )
1731+ @ SuppressWarnings ("removal" )
16851732 public <S extends AbstractMessageSplitter > B split (S splitter ,
16861733 @ Nullable Consumer <SplitterEndpointSpec <S >> endpointConfigurer ) {
16871734
0 commit comments