Class PythonCodeFactory

java.lang.Object
org.eclipse.ease.AbstractCodeFactory
org.eclipse.ease.lang.python.PythonCodeFactory
All Implemented Interfaces:
ICodeFactory

public class PythonCodeFactory
extends AbstractCodeFactory
  • Field Details

    • RESERVED_KEYWORDS

      public static final List<String> RESERVED_KEYWORDS
  • Constructor Details

    • PythonCodeFactory

      public PythonCodeFactory()
  • Method Details

    • createFunctionWrapper

      public String createFunctionWrapper​(IEnvironment environment, String moduleVariable, Method method)
    • 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)
    • createPep302WrapperCode

      public String createPep302WrapperCode​(EnvironmentModule environment, Object instance, String identifier)
      Create wrapper code for Pep302 import statements.
      Parameters:
      environment - script environment instance
      instance - instance to wrap
      identifier - instance identifier to be used
      Returns:
      wrapper code to be loaded by python