public abstract class AbstractMenuConfigHandler extends AbstractWeiXinHandler
Modifier and Type | Field and Description |
---|---|
protected static String |
MENU_ID_NAME |
LOGGER
Constructor and Description |
---|
AbstractMenuConfigHandler() |
Modifier and Type | Method and Description |
---|---|
protected abstract <T> String |
getContent(T message)
获得消息的文本内容
|
MenuConfigManager |
getMenuConfigManager() |
WeiXinHandlerMode |
getWeiXinHandlerMode() |
WeiXinSessionManager |
getWeiXinSessionManager() |
<T> boolean |
isMatch(T message,
WeiXinContext context)
是否匹配对象和上下文
|
protected boolean |
isMatchByMenuId(WeiXinSession session)
判断菜单Id是否存在于用户会话(适合菜单已经建立)
|
protected boolean |
isMatchMessage(String content,
WeiXinContext context)
根据消息内容判断是否存在匹配的菜单(适合菜单还未建立)
|
protected abstract <T> boolean |
isMatchType(T message)
判断消息类型是否一致
|
<T> void |
process(T message,
WeiXinContext context)
处理对象
|
void |
setMenuConfigManager(MenuConfigManager menuConfigManager) |
void |
setWeiXinSessionManager(WeiXinSessionManager weiXinSessionManager) |
protected abstract <T,OUTPUT> OUTPUT |
wrapperReplyMessage(T message,
String content)
对响应消息进行包装并返回
|
compareTo, getPriority, setPriority
protected static final String MENU_ID_NAME
public MenuConfigManager getMenuConfigManager()
public void setMenuConfigManager(MenuConfigManager menuConfigManager)
public WeiXinSessionManager getWeiXinSessionManager()
public void setWeiXinSessionManager(WeiXinSessionManager weiXinSessionManager)
public WeiXinHandlerMode getWeiXinHandlerMode()
public <T> boolean isMatch(T message, WeiXinContext context)
WeiXinHandler
public <T> void process(T message, WeiXinContext context)
WeiXinHandler
protected boolean isMatchByMenuId(WeiXinSession session)
session
- protected boolean isMatchMessage(String content, WeiXinContext context)
content
- protected abstract <T> boolean isMatchType(T message)
T
- message
- protected abstract <T> String getContent(T message)
T
- message
- protected abstract <T,OUTPUT> OUTPUT wrapperReplyMessage(T message, String content)
T
- OUTPUT
- message
- content
- Copyright © 2006–2018 TinyGroup. All rights reserved.