【发布时间】:2018-03-16 06:30:53
【问题描述】:
Intellij Idea 像这样格式化骆驼溃败中的代码:
from("direct:loop")
.log("Loop: ${header[loopCount]}")
.choice()
.when(simple("header[loopCount] < 10"))
.process(exchange -> {
Message in = exchange.getIn();
in.setHeader("loopCount", in.getHeader("loopCount", Integer.class) + 1);
})
.to("direct:loop")
.otherwise()
.log("Exiting loop")
.end();
是否有任何插件或其他方法可以这样做:
from("direct:loop")
.log("Loop: ${header[loopCount]}")
.choice()
.when(simple("header[loopCount] < 10"))
.process(exchange -> {
Message in = exchange.getIn();
in.setHeader("loopCount", in.getHeader("loopCount", Integer.class) + 1);
})
.to("direct:loop")
.otherwise()
.log("Exiting loop")
.end();
?
【问题讨论】:
-
close voter - 为什么这离题了?这是一个关于 DSL 和编程工具的明确问题。如果您不理解问题,请询问原因。
-
@well - 我从来没有找到这样做的方法,所以不要格式化代码。很高兴在 DSL 代码中有缩进......只是永远不要使用自动格式功能。
标签: java intellij-idea apache-camel