public abstract class AbstractCodeFactory extends Object implements ICodeFactory
ICodeFactory.Parameter| Modifier and Type | Field and Description |
|---|---|
static String |
LINE_DELIMITER
Default line break character.
|
TRACE_MODULE_WRAPPER| Constructor and Description |
|---|
AbstractCodeFactory() |
| Modifier and Type | Method and Description |
|---|---|
String |
createCommentedString(String comment,
boolean addBlockComment)
Create code for the provided comment.
|
String |
createFunctionCall(Method method,
Object... parameters)
Create code to call a wrapped function.
|
String |
createKeywordHeader(Map<String,String> keywords,
String existingHeader)
Create a comment header for given keywords.
|
String |
createWrapper(IEnvironment environment,
Object instance,
String identifier,
boolean customNamespace,
IScriptEngine engine)
Create script wrapper code for a given java instance.
|
String |
getDefaultValue(ICodeFactory.Parameter parameter)
Get the default value for a given parameter
|
static Collection<String> |
getMethodAliases(Method method) |
static Collection<String> |
getMethodNames(Method method) |
static String |
getPostExecutionCode(IEnvironment environment,
Method method) |
static String |
getPreExecutionCode(IEnvironment environment,
Method method) |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclassInstantiation, getSaveVariableNamepublic static final String LINE_DELIMITER
public String createKeywordHeader(Map<String,String> keywords, String existingHeader)
ICodeFactorycreateKeywordHeader in interface ICodeFactorykeywords - key:value pairs to be storedexistingHeader - current header to copy plain text frompublic String getDefaultValue(ICodeFactory.Parameter parameter)
ICodeFactorygetDefaultValue in interface ICodeFactoryparameter - parameter to get default value forpublic static Collection<String> getMethodNames(Method method)
public static Collection<String> getMethodAliases(Method method)
public static String getPreExecutionCode(IEnvironment environment, Method method)
public static String getPostExecutionCode(IEnvironment environment, Method method)
public String createFunctionCall(Method method, Object... parameters)
ICodeFactory#createFunctionWrapper(IEnvironment, String, Method) before.createFunctionCall in interface ICodeFactorymethod - method to be calledparameters - call parameterspublic String createCommentedString(String comment, boolean addBlockComment)
ICodeFactorycreateCommentedString in interface ICodeFactorycomment - the commentaddBlockComment - true for adding block comment or false for adding (multiple) line commentspublic String createWrapper(IEnvironment environment, Object instance, String identifier, boolean customNamespace, IScriptEngine engine)
ICodeFactorycreateWrapper in interface ICodeFactoryenvironment - 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