public class JavaScriptCodeFactory extends AbstractCodeFactory
ICodeFactory.Parameter| Modifier and Type | Field and Description |
|---|---|
static java.util.List<java.lang.String> |
RESERVED_KEYWORDS |
LINE_DELIMITERTRACE_MODULE_WRAPPER| Constructor and Description |
|---|
JavaScriptCodeFactory() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
classInstantiation(java.lang.Class<?> clazz,
java.lang.String[] parameters)
Create code to instantiate a java class.
|
java.lang.String |
createCommentedString(java.lang.String comment,
boolean addBlockComment)
Create code for the provided comment.
|
java.lang.String |
createWrapper(IEnvironment environment,
java.lang.Object instance,
java.lang.String identifier,
boolean customNamespace,
IScriptEngine engine)
Create script wrapper code for a given java instance.
|
java.lang.String |
getSaveVariableName(java.lang.String variableName)
Converts a given string to a save variable name for the target language.
|
createFunctionCall, createKeywordHeader, getDefaultValue, getMethodAliases, getMethodNames, getPostExecutionCode, getPreExecutionCodepublic java.lang.String classInstantiation(java.lang.Class<?> clazz,
java.lang.String[] parameters)
ICodeFactoryclazz - class to instantiateparameters - parameters used for class instantiationpublic java.lang.String getSaveVariableName(java.lang.String variableName)
ICodeFactoryvariableName - variable name candidatepublic java.lang.String createCommentedString(java.lang.String comment,
boolean addBlockComment)
ICodeFactorycreateCommentedString in interface ICodeFactorycreateCommentedString in class AbstractCodeFactorycomment - the commentaddBlockComment - true for adding block comment or false for adding (multiple) line commentspublic java.lang.String createWrapper(IEnvironment environment, java.lang.Object instance, java.lang.String identifier, boolean customNamespace, IScriptEngine engine)
ICodeFactorycreateWrapper in interface ICodeFactorycreateWrapper in class AbstractCodeFactoryenvironment - environment module instanceinstance - object instance to wrapidentifier - script variable name for wrapped Java objectcustomNamespace - whether to store methods to the global namespace or to create a custom objectengine - script engine