Package com.foxinmy.weixin4j.model
Class Button
- java.lang.Object
-
- com.foxinmy.weixin4j.model.Button
-
- All Implemented Interfaces:
Serializable
public class Button extends Object implements Serializable
菜单按钮目前自定义菜单最多包括3个一级菜单,每个一级菜单最多包含5个二级菜单,一级菜单最多4个汉字,二级菜单最多7个汉字,多出来的部分将会以"..."代替 请注意,创建自定义菜单后,由于微信客户端缓存,需要24小时微信客户端才会展现出来,建议测试时可以尝试取消关注公众账号后再次关注,则可以看到创建后的效果
- Since:
- JDK 1.6
- Author:
- jinyu(foxinmy@gmail.com)
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getAppid()
String
getContent()
Object
getExtra()
String
getName()
String
getPagepath()
List<Button>
getSubs()
String
getType()
Button
pushSub(Button btn)
void
setAppid(String appid)
void
setContent(String content)
void
setExtra(Object extra)
扩展只读属性,设置无效void
setName(String name)
void
setPagepath(String pagepath)
void
setSubs(List<Button> subs)
void
setType(ButtonType type)
void
setType(String type)
String
toString()
-
-
-
Constructor Detail
-
Button
protected Button()
-
Button
public Button(String name, Button... subButtons)
创建一个具有子菜单的菜单- Parameters:
name
- 菜单名subButtons
- 二级菜单列表
-
Button
public Button(String name, String content, ButtonType type)
创建一个普通菜单- Parameters:
name
- 菜单名content
- 菜单内容type
- 菜单类型
-
-
Method Detail
-
getName
public String getName()
-
setName
public void setName(String name)
-
getType
public String getType()
-
setType
public void setType(String type)
-
setType
public void setType(ButtonType type)
-
getContent
public String getContent()
-
setContent
public void setContent(String content)
-
getExtra
public Object getExtra()
-
setExtra
public void setExtra(Object extra)
扩展只读属性,设置无效- Parameters:
extra
-
-
getAppid
public String getAppid()
-
setAppid
public void setAppid(String appid)
-
getPagepath
public String getPagepath()
-
setPagepath
public void setPagepath(String pagepath)
-
-