S - the generic type of the Settings objectpublic class JavascriptGenerator<S extends Settings> extends Object implements Serializable
StringTextTemplate.| Modifier and Type | Field and Description |
|---|---|
static String |
COMPONENT_ID
The Constant COMPONENT_ID.
|
static String |
DOCUMENT_READY_FUNCTION_PREFIX
The Constant DOCUMENT_READY_FUNCTION_PREFIX.
|
static String |
DOCUMENT_READY_FUNCTION_SUFFIX
The Constant DOCUMENT_READY_FUNCTION_SUFFIX.
|
protected static org.slf4j.Logger |
LOGGER
The LOGGER.
|
| Constructor and Description |
|---|
JavascriptGenerator(S settings)
Instantiates a new javascript generator.
|
| Modifier and Type | Method and Description |
|---|---|
protected String |
generateJavascriptTemplateContent(Map<String,Object> variables,
String methodName)
Generates the javascript template code from the given map and the given method name that will
be used to interpolate with the values of the given map.
|
String |
generateJs()
Generate js.
|
String |
generateJs(Settings settings,
String methodName)
Generate the javascript code.
|
protected void |
generateJsOptionsForTemplateContent(Map<String,Object> variables,
StringBuilder sb)
Generate the javascript options for template content.
|
protected Map<String,Object> |
initializeVariables(Set<StringTextValue<?>> allSettings)
Sets the values to the map.
|
public static final String COMPONENT_ID
public static final String DOCUMENT_READY_FUNCTION_PREFIX
public static final String DOCUMENT_READY_FUNCTION_SUFFIX
protected static final org.slf4j.Logger LOGGER
public JavascriptGenerator(S settings)
settings - the settingsprotected String generateJavascriptTemplateContent(Map<String,Object> variables, String methodName)
variables - the map with the javascript options.methodName - The method name.public String generateJs()
public String generateJs(Settings settings, String methodName)
settings - the settingsmethodName - the method nameprotected void generateJsOptionsForTemplateContent(Map<String,Object> variables, StringBuilder sb)
variables - the map with the javascript options.sb - the StringBuilder to add the javascript options.protected Map<String,Object> initializeVariables(Set<StringTextValue<?>> allSettings)
allSettings - All settings as a list of StringTextValue(s).Copyright © 2015 Alpha Ro Group UG (haftungsbeschrÀngt). All rights reserved.