@Test(enabled = false) public void prepare(boolean async, StringBuffer sb, WxMpMessageRouter router) { router .rule() .async(async) .msgType(WxConsts.XmlMsgType.TEXT).event(WxConsts.EventType.CLICK).eventKey("KEY_1").content("CONTENT_1") .handler(new WxEchoMpMessageHandler(sb, "COMBINE_4")) .end() .rule() .async(async) .msgType(WxConsts.XmlMsgType.TEXT).event(WxConsts.EventType.CLICK).eventKey("KEY_1") .handler(new WxEchoMpMessageHandler(sb, "COMBINE_3")) .end() .rule() .async(async) .msgType(WxConsts.XmlMsgType.TEXT).event(WxConsts.EventType.CLICK) .handler(new WxEchoMpMessageHandler(sb, "COMBINE_2")) .end() .rule().async(async).msgType(WxConsts.XmlMsgType.TEXT).handler(new WxEchoMpMessageHandler(sb, WxConsts.XmlMsgType.TEXT)).end() .rule().async(async).event(WxConsts.EventType.CLICK).handler(new WxEchoMpMessageHandler(sb, WxConsts.EventType.CLICK)).end() .rule().async(async).eventKey("KEY_1").handler(new WxEchoMpMessageHandler(sb, "KEY_1")).end() .rule().async(async).eventKeyRegex("KEY_1*").handler(new WxEchoMpMessageHandler(sb, "KEY_123")).end() .rule().async(async).content("CONTENT_1").handler(new WxEchoMpMessageHandler(sb, "CONTENT_1")).end() .rule().async(async).rContent(".*bc.*").handler(new WxEchoMpMessageHandler(sb, "abcd")).end() .rule().async(async).matcher(new WxMpMessageMatcher() { @Override public boolean match(WxMpXmlMessage message) { return "strangeformat".equals(message.getFormat()); } }).handler(new WxEchoMpMessageHandler(sb, "matcher")).end() .rule().async(async).handler(new WxEchoMpMessageHandler(sb, "ALL")).end(); }
public WxMpMessageRouterRule rule() { return new WxMpMessageRouterRule(this); }
WxMpMessageRouter { public WxMpMessageRouterRule rule() { return new WxMpMessageRouterRule(this); } }
WxMpMessageRouter { public WxMpMessageRouterRule rule() { return new WxMpMessageRouterRule(this); } WxMpMessageRouter(WxMpService wxMpService);  WxMpMessageRouter(WxMpService wxMpService, ExecutorService executorService); }
WxMpMessageRouter { public WxMpMessageRouterRule rule() { return new WxMpMessageRouterRule(this); } WxMpMessageRouter(WxMpService wxMpService);  WxMpMessageRouter(WxMpService wxMpService, ExecutorService executorService); void shutDownExecutorService(); void setExecutorService(ExecutorService executorService); void setMessageDuplicateChecker(WxMessageDuplicateChecker messageDuplicateChecker); void setSessionManager(WxSessionManager sessionManager); void setExceptionHandler(WxErrorExceptionHandler exceptionHandler); WxMpMessageRouterRule rule(); WxMpXmlOutMessage route(final WxMpXmlMessage wxMessage, final Map<String, Object> context); WxMpXmlOutMessage route(final WxMpXmlMessage wxMessage, final Map<String, Object> context, WxMpService wxMpService); WxMpXmlOutMessage route(final WxMpXmlMessage wxMessage); }
WxMpMessageRouter { public WxMpMessageRouterRule rule() { return new WxMpMessageRouterRule(this); } WxMpMessageRouter(WxMpService wxMpService);  WxMpMessageRouter(WxMpService wxMpService, ExecutorService executorService); void shutDownExecutorService(); void setExecutorService(ExecutorService executorService); void setMessageDuplicateChecker(WxMessageDuplicateChecker messageDuplicateChecker); void setSessionManager(WxSessionManager sessionManager); void setExceptionHandler(WxErrorExceptionHandler exceptionHandler); WxMpMessageRouterRule rule(); WxMpXmlOutMessage route(final WxMpXmlMessage wxMessage, final Map<String, Object> context); WxMpXmlOutMessage route(final WxMpXmlMessage wxMessage, final Map<String, Object> context, WxMpService wxMpService); WxMpXmlOutMessage route(final WxMpXmlMessage wxMessage);  }