1.1 --- a/boot/src/main/java/org/apidesign/html/boot/spi/Fn.java Wed Jan 08 14:02:27 2014 +0100
1.2 +++ b/boot/src/main/java/org/apidesign/html/boot/spi/Fn.java Thu Jan 09 20:39:23 2014 +0100
1.3 @@ -265,4 +265,24 @@
1.4 */
1.5 public Object toJavaScript(Object toReturn);
1.6 }
1.7 +
1.8 + /** Additional interface to be implemented by {@link Presenter}s that
1.9 + * need to convert JavaScript object (usually array) to Java object
1.10 + * when calling back from JavaScript to Java.
1.11 + * <p>
1.12 + * <em>Note:</em> The implementation based on <em>JavaFX</em>
1.13 + * <code>WebView</code> uses this interface to convert JavaScript arrays to
1.14 + * Java ones.
1.15 + *
1.16 + * @since 0.7
1.17 + */
1.18 + public interface FromJavaScript {
1.19 + /** Convert a JavaScript object into suitable Java representation
1.20 + * before a Java method is called with this object as an argument.
1.21 + *
1.22 + * @param js the JavaScript object
1.23 + * @return replacement object for
1.24 + */
1.25 + public Object toJava(Object js);
1.26 + }
1.27 }