org.eclipse.ease.lang.python

## Class PythonCodeFactory

- java.lang.Object
- - org.eclipse.ease.AbstractCodeFactory
  - - org.eclipse.ease.lang.python.PythonCodeFactory

All Implemented Interfaces:
  ICodeFactory

    public class PythonCodeFactory
    extends AbstractCodeFactory

### Nested Class Summary

### Nested classes/interfaces inherited from interface org.eclipse.ease.ICodeFactory

`ICodeFactory.Parameter`

### Field Summary

Fields
`static List<String>` `RESERVED_KEYWORDS`

### Fields inherited from class org.eclipse.ease.AbstractCodeFactory

`LINE_DELIMITER`

### Fields inherited from interface org.eclipse.ease.ICodeFactory

`TRACE_MODULE_WRAPPER`

### Constructor Summary

Constructors
Constructor and Description
`PythonCodeFactory()`

### Method Summary

All Methods Instance Methods Concrete Methods
`String` `classInstantiation(Class<?> clazz, String[] parameters)` Create code to instantiate a java class.
`String` `createFinalFieldWrapper(IEnvironment environment, String moduleVariable, Field field)` Create code to bind a final java field to a script variable.
`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` `getSaveVariableName(String variableName)` Converts a given string to a save variable name for the target language.
`boolean` `isValidMethodName(String methodName)`

### Methods inherited from class org.eclipse.ease.AbstractCodeFactory

`createCommentedString, createCommentedString, createFunctionCall, createKeywordHeader, getDefaultValue, getMethodNames, getPostExecutionCode, getPreExecutionCode`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### RESERVED_KEYWORDS

    public static List<String> RESERVED_KEYWORDS

### Constructor Detail

#### PythonCodeFactory

    public PythonCodeFactory()

### Method Detail

#### createFunctionWrapper

    public String createFunctionWrapper(IEnvironment environment,
                                        String moduleVariable,
                                        Method method)

Description copied from interface: `ICodeFactory`
Create code to wrap a java method call on a given script variable to the target language. Creates script code that invokes the given method on the given moduleVariable.

Parameters:
  `environment` - script environment
  `moduleVariable` - name of variable holding the module instance
  `method` - method to be wrapped
Returns:
  wrapped script code

#### getSaveVariableName

    public String getSaveVariableName(String variableName)

Description copied from interface: `ICodeFactory`
Converts a given string to a save variable name for the target language. Typically filters invalid characters and verifies that the returned string does not match any reserved keyword. Does not verify if the returned name is already in use.

Parameters:
  `variableName` - variable name candidate
Returns:
  converted variable name

#### classInstantiation

    public String classInstantiation(Class<?> clazz,
                                     String[] parameters)

Description copied from interface: `ICodeFactory`
Create code to instantiate a java class.

Parameters:
  `clazz` - class to instantiate
  `parameters` - parameters used for class instantiation
Returns:
  wrapped script code

#### isValidMethodName

    public boolean isValidMethodName(String methodName)

#### createFinalFieldWrapper

    public String createFinalFieldWrapper(IEnvironment environment,
                                          String moduleVariable,
                                          Field field)

Description copied from interface: `ICodeFactory`
Create code to bind a final java field to a script variable.

Parameters:
  `environment` - script environment
  `moduleVariable` - name of variable holding the module instance
  `field` - field to be accessed
Returns:
  wrapped script code