public class PythonCodeFactory extends AbstractCodeFactory
ICodeFactory.Parameter| Modifier and Type | Field and Description |
|---|---|
static java.util.List<java.lang.String> |
RESERVED_KEYWORDS |
LINE_DELIMITERRESULT_NAME, TRACE_MODULE_WRAPPER| Constructor and Description |
|---|
PythonCodeFactory() |
| 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 |
createFunctionWrapper(IEnvironment environment,
java.lang.String moduleVariable,
java.lang.reflect.Method method)
Create code for a wrapper function in the global namespace of the script engine.
|
java.lang.String |
createPep302WrapperCode(EnvironmentModule environment,
java.lang.Object instance,
java.lang.String identifier)
Create wrapper code for Pep302 import statements.
|
java.lang.String |
getSaveVariableName(java.lang.String variableName)
Converts a given string to a save variable name for the target language.
|
boolean |
isValidMethodName(java.lang.String methodName) |
createCommentedString, createFunctionCall, createKeywordHeader, createWrapper, getDefaultValue, getMethodAliases, getMethodNamespublic java.lang.String createFunctionWrapper(IEnvironment environment, java.lang.String moduleVariable, java.lang.reflect.Method method)
AbstractCodeFactoryenvironment - environment instancemoduleVariable - function name to be usedmethod - method to refer topublic java.lang.String getSaveVariableName(java.lang.String variableName)
ICodeFactoryvariableName - variable name candidatepublic java.lang.String classInstantiation(java.lang.Class<?> clazz,
java.lang.String[] parameters)
ICodeFactoryclazz - class to instantiateparameters - parameters used for class instantiationpublic boolean isValidMethodName(java.lang.String methodName)
public java.lang.String createPep302WrapperCode(EnvironmentModule environment, java.lang.Object instance, java.lang.String identifier)
environment - script environment instanceinstance - instance to wrapidentifier - instance identifier to be used