public class WxCpTpMessageRouterRule
extends java.lang.Object
限定符 | 构造器和说明 |
---|---|
protected |
WxCpTpMessageRouterRule(WxCpTpMessageRouter routerBuilder)
Instantiates a new Wx cp message router rule.
|
限定符和类型 | 方法和说明 |
---|---|
WxCpTpMessageRouterRule |
async(boolean async)
设置是否异步执行,默认是true
|
WxCpTpMessageRouterRule |
changeType(java.lang.String changeType)
如果changeType等于这个type,符合rule的条件之一
|
WxCpTpMessageRouter |
end()
规则结束,代表如果一个消息匹配该规则,那么它将不再会进入其他规则
|
WxCpTpMessageRouterRule |
event(java.lang.String event)
如果event等于某值
|
WxCpTpMessageRouterRule |
handler(WxCpTpMessageHandler handler)
设置微信消息处理器
|
WxCpTpMessageRouterRule |
handler(WxCpTpMessageHandler handler,
WxCpTpMessageHandler... otherHandlers)
设置微信消息处理器
|
WxCpTpMessageRouterRule |
infoType(java.lang.String infoType)
匹配 Message infoType
|
WxCpTpMessageRouterRule |
interceptor(WxCpTpMessageInterceptor interceptor)
设置微信消息拦截器
|
WxCpTpMessageRouterRule |
interceptor(WxCpTpMessageInterceptor interceptor,
WxCpTpMessageInterceptor... otherInterceptors)
设置微信消息拦截器
|
WxCpTpMessageRouterRule |
matcher(WxCpTpMessageMatcher matcher)
如果消息匹配某个matcher,用在用户需要自定义更复杂的匹配规则的时候
|
WxCpTpMessageRouterRule |
msgType(java.lang.String msgType)
如果msgType等于某值
|
WxCpTpMessageRouter |
next()
规则结束,但是消息还会进入其他规则
|
protected WxCpXmlOutMessage |
service(WxCpTpXmlMessage wxMessage,
java.util.Map<java.lang.String,java.lang.Object> context,
WxCpTpService wxCpService,
me.chanjar.weixin.common.session.WxSessionManager sessionManager,
me.chanjar.weixin.common.api.WxErrorExceptionHandler exceptionHandler)
处理微信推送过来的消息
|
protected boolean |
test(WxCpTpXmlMessage wxMessage)
Test boolean.
|
protected WxCpTpMessageRouterRule(WxCpTpMessageRouter routerBuilder)
routerBuilder
- the router builderpublic WxCpTpMessageRouterRule async(boolean async)
async
- the asyncpublic WxCpTpMessageRouterRule msgType(java.lang.String msgType)
msgType
- the msg typepublic WxCpTpMessageRouterRule event(java.lang.String event)
event
- the eventpublic WxCpTpMessageRouterRule infoType(java.lang.String infoType)
infoType
- infopublic WxCpTpMessageRouterRule changeType(java.lang.String changeType)
changeType
- changeTypepublic WxCpTpMessageRouterRule matcher(WxCpTpMessageMatcher matcher)
matcher
- the matcherpublic WxCpTpMessageRouterRule interceptor(WxCpTpMessageInterceptor interceptor)
interceptor
- the interceptorpublic WxCpTpMessageRouterRule interceptor(WxCpTpMessageInterceptor interceptor, WxCpTpMessageInterceptor... otherInterceptors)
interceptor
- the interceptorotherInterceptors
- the other interceptorspublic WxCpTpMessageRouterRule handler(WxCpTpMessageHandler handler)
handler
- the handlerpublic WxCpTpMessageRouterRule handler(WxCpTpMessageHandler handler, WxCpTpMessageHandler... otherHandlers)
handler
- the handlerotherHandlers
- the other handlerspublic WxCpTpMessageRouter end()
public WxCpTpMessageRouter next()
protected boolean test(WxCpTpXmlMessage wxMessage)
wxMessage
- the wx messageprotected WxCpXmlOutMessage service(WxCpTpXmlMessage wxMessage, java.util.Map<java.lang.String,java.lang.Object> context, WxCpTpService wxCpService, me.chanjar.weixin.common.session.WxSessionManager sessionManager, me.chanjar.weixin.common.api.WxErrorExceptionHandler exceptionHandler)
wxMessage
- the wx messagecontext
- the contextwxCpService
- the wx cp servicesessionManager
- the session managerexceptionHandler
- the exception handler