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)
Create code for the provided comment.
|
String |
createCommentedString(String comment,
boolean addBlockComment)
Create code for the provided comment.
|
String |
createFinalFieldWrapper(IEnvironment environment,
String moduleVariable,
Field field)
Create code to bind a final java field to a script variable.
|
String |
createFunctionCall(Method method,
Object... parameters)
Create code to call a wrapped function.
|
String |
createFunctionWrapper(IEnvironment environment,
String moduleVariable,
Method method)
Create code to wrap a java method call on a given script variable to the target language.
|
String |
createKeywordHeader(Map<String,String> keywords,
String existingHeader)
Create a comment header for given keywords.
|
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 createFunctionWrapper(IEnvironment environment, String moduleVariable, Method method)
environment
- script environmentmoduleVariable
- name of variable holding the module instancemethod
- method to be wrappedString classInstantiation(Class<?> clazz, String[] parameters)
clazz
- class to instantiateparameters
- parameters used for class instantiationString createFinalFieldWrapper(IEnvironment environment, String moduleVariable, Field field)
environment
- script environmentmoduleVariable
- name of variable holding the module instancefield
- field to be accessedString 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)
comment
- the commentString createCommentedString(String comment, boolean addBlockComment)
comment
- the commentaddBlockComment
- true
for adding block comment or false
for adding single line commentString createKeywordHeader(Map<String,String> keywords, String existingHeader)
keywords
- key:value pairs to be storedexistingHeader
- current header to copy plain text from