public interface ICodeFactory
Modifier and Type | Interface and Description |
---|---|
static class |
ICodeFactory.Parameter
Parameter definition class.
|
Modifier and Type | Field and Description |
---|---|
static boolean |
TRACE_MODULE_WRAPPER
Trace enablement for module wrappers.
|
Modifier and Type | Method and Description |
---|---|
String |
classInstantiation(Class<?> clazz,
String[] parameters)
Create code to instantiate a java class.
|
String |
createCommentedString(String comment,
boolean blockComment)
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
|
String |
getSaveVariableName(String variableName)
Converts a given string to a save variable name for the target language.
|
static final boolean TRACE_MODULE_WRAPPER
String getSaveVariableName(String variableName)
variableName
- variable name candidateString classInstantiation(Class<?> clazz, String[] parameters)
clazz
- class to instantiateparameters
- parameters used for class instantiationString createFunctionCall(Method method, Object... parameters)
#createFunctionWrapper(IEnvironment, String, Method)
before.method
- method to be calledparameters
- call parametersString getDefaultValue(ICodeFactory.Parameter parameter)
parameter
- parameter to get default value forString createCommentedString(String comment, boolean blockComment)
comment
- the commentblockComment
- true
for adding block comment or false
for adding (multiple) line commentsString createKeywordHeader(Map<String,String> keywords, String existingHeader)
keywords
- key:value pairs to be storedexistingHeader
- current header to copy plain text fromString createWrapper(IEnvironment environment, Object instance, String identifier, boolean customNamespace, IScriptEngine engine)
environment
- 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