Water 5-System Interfaces-Water to JavaContract| No input parameters. | | Parameter kind | Default value | Type | | Other keyed arguments | opt | | Water Contract<class java
_interpreter =<ja.bsh.Interpreter/>
_java_pkgname="java"
_other_keyed =opt=wob="_add_to_environment"
/> | |
You can execute java source code using java which provides a
water interface to a Java environment.
java.<execute> 3 < 4; </execute>
 | true |
Make an instance of a Java environment and initialize some
local variables to values computed by Water code, then
call execute with that Java environment.
<set J = <java a=2 b=3.<plus 4/> /> />
J.<execute> a + b </execute>
 | 9 |
set can add local variables to an existing instance of java.
<java/>.<set a=2 b=3/>
set_value is similar to set except that
this allows you to set only one variable. However, unlike set ,
the name of that variable may be computed by arbitrary Water code.
<java/>.<set_value "foo" 22/>
<java a=3 b=4/>.<execute> a + b;</execute>
 | 7 |
<java/>.<set a=3 b=4/>.<execute> a > b </execute>
 | false |
If the source argument is present and called with a keyword, its value will be the
string of Java code to execute.
java.<execute source="3 < 4"/>
 | true |
© Copyright 2007 Clear Methods, Inc.