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