|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.drools.semantics.python.PythonInterp
Base class for Jython interpreter-based Python semantic components.
![]() |
![]() |
![]() |
![]() |
Constructor Summary | |
protected |
PythonInterp(java.lang.String text,
Rule rule,
java.lang.String type)
Construct. |
Method Summary | |
protected org.python.core.PyCode |
getCode()
Retrieve the compiled code. |
protected org.python.core.PyDictionary |
getGlobals()
|
org.python.core.PyDictionary |
getGlobals(java.lang.String text)
Parses a python script and returns the globals It is used to be able to inject imports and functions into code when being executed by Py.runCode(...) |
protected org.python.parser.ast.modType |
getNode()
Retrieve the AST node. |
protected Rule |
getRule()
|
java.lang.String |
getText()
Retrieve the text to evaluate. |
protected org.python.core.PyDictionary |
setUpDictionary(Tuple tuple,
java.util.Iterator declIter)
Configure a PyDictionary using a Tuple for
variable bindings. |
protected static java.lang.String |
stripOuterIndention(java.lang.String text)
Trims leading indention from the block of text. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected PythonInterp(java.lang.String text, Rule rule, java.lang.String type)
Method Detail |
public org.python.core.PyDictionary getGlobals(java.lang.String text)
text
-
protected static java.lang.String stripOuterIndention(java.lang.String text)
| <python:consequence> | if hello == 'Hello': | print "Hi" | else: | print "Bye" | </python:consequence>is transformed into:
| <python:consequence> |if hello == 'Hello': | print "Hi" |else: | print "Bye" | </python:consequence>
text
- the block of text to be stripped
public java.lang.String getText()
protected Rule getRule()
protected org.python.core.PyCode getCode()
protected org.python.parser.ast.modType getNode()
protected org.python.core.PyDictionary getGlobals()
protected org.python.core.PyDictionary setUpDictionary(Tuple tuple, java.util.Iterator declIter) throws java.lang.Exception
PyDictionary
using a Tuple
for
variable bindings.
java.lang.Exception
tuple
- Tuple containing variable bindings.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |