Package com.foxinmy.weixin4j.handler
Class MultipleMessageHandlerAdapter
- java.lang.Object
-
- com.foxinmy.weixin4j.handler.MultipleMessageHandlerAdapter
-
- All Implemented Interfaces:
WeixinMessageHandler
public abstract class MultipleMessageHandlerAdapter extends Object implements WeixinMessageHandler
多个消息类型适配- Since:
- JDK 1.6
- Author:
- jinyu(foxinmy@gmail.com)
-
-
Constructor Summary
Constructors Constructor Description MultipleMessageHandlerAdapter(Class<? extends WeixinMessage>... messageClasses)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canHandle(WeixinRequest request, WeixinMessage message, Set<String> nodeNames)
能否处理请求protected boolean
canHandle0(WeixinRequest request, WeixinMessage message)
能否处理请求int
weight()
用于匹配到多个MessageHandler时权重降序排列,数字越大优先级越高-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.foxinmy.weixin4j.handler.WeixinMessageHandler
doHandle
-
-
-
-
Constructor Detail
-
MultipleMessageHandlerAdapter
public MultipleMessageHandlerAdapter(Class<? extends WeixinMessage>... messageClasses)
-
-
Method Detail
-
canHandle
public boolean canHandle(WeixinRequest request, WeixinMessage message, Set<String> nodeNames)
Description copied from interface:WeixinMessageHandler
能否处理请求- Specified by:
canHandle
in interfaceWeixinMessageHandler
- Parameters:
request
- 微信请求message
- 微信消息nodeNames
- 节点名称集合- Returns:
- true则执行doHandle
-
canHandle0
protected boolean canHandle0(WeixinRequest request, WeixinMessage message)
能否处理请求- Parameters:
request
- 微信请求message
- 微信消息- Returns:
- true则执行doHandler
- Throws:
WeixinException
-
weight
public int weight()
Description copied from interface:WeixinMessageHandler
用于匹配到多个MessageHandler时权重降序排列,数字越大优先级越高- Specified by:
weight
in interfaceWeixinMessageHandler
- Returns:
- 权重
-
-