public class BaseRenderer extends Object implements BotMessageRenderer
| Modifier and Type | Field and Description |
|---|---|
static String |
FIELD_BUTTONS |
static String |
FIELD_SUBTITLE |
static String |
FIELD_TITLE |
static String |
FIELD_VALUE |
| Constructor and Description |
|---|
BaseRenderer() |
| Modifier and Type | Method and Description |
|---|---|
protected List<Map<String,Object>> |
getButtons(Map<String,Object> mapContent)
Gets the buttons list
|
protected String |
getButtonTitle(Map<String,Object> mapButton)
The button title
|
protected String |
getButtonValue(Map<String,Object> mapButton)
The button value
|
String |
getMessageType()
Return the message type handled by the renderer
|
protected String |
getSubTitle(Map<String,Object> mapContent)
Get message subtitle
|
String |
getTemplate()
Returns the template
|
protected String |
getTitle(Map<String,Object> mapContent)
Get message title
|
String |
render(Object content)
Render a bot message
|
void |
setMessageType(String strType)
Set the message type
|
void |
setTemplate(String strTemplate)
Set the template to convert from JSON to HTML
|
public static final String FIELD_TITLE
public static final String FIELD_SUBTITLE
public static final String FIELD_BUTTONS
public static final String FIELD_VALUE
public String render(Object content)
render in interface BotMessageRenderercontent - The contentprotected String getTitle(Map<String,Object> mapContent)
mapContent - The map contentprotected String getSubTitle(Map<String,Object> mapContent)
mapContent - The map contentprotected List<Map<String,Object>> getButtons(Map<String,Object> mapContent)
mapContent - The contentprotected String getButtonTitle(Map<String,Object> mapButton)
mapButton - the button mapprotected String getButtonValue(Map<String,Object> mapButton)
mapButton - The button mappublic String getMessageType()
getMessageType in interface BotMessageRendererpublic void setMessageType(String strType)
strType - The typepublic void setTemplate(String strTemplate)
strTemplate - The templatepublic String getTemplate()
Copyright © 2018 City of Paris. All rights reserved.