/** * Creates a formatter using the provided Python code snippet. Within the snippet, the following * variables are available: * <li>o: a proxy to the reconstituted object. Use o.n to access the value of field n of o. * Example: <code> * return "x: "+o.x+", y: "+o.y * </code> */ public IPyObjectFormatter createFormatter(String aFunctionBody) { // initFactory(); // Temp. This is for debugging. String theImports = "from java.util import *\n"; String theDef = theImports + "def func(o):\n" + Utils.indent(aFunctionBody, 1, "\t"); itsInterpreter.exec(theDef); PyFunction theFunction = (PyFunction) itsInterpreter.get("func"); return itsFactory.createFormatter(theFunction); }
Object createTODObject(ReconstitutedObject aObject) { return itsFactory.createTODObject(aObject); }