You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Sources/SwiftJavaDocumentation/Documentation.docc/SwiftJavaCommandLineTool.md
+100Lines changed: 100 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -214,6 +214,106 @@ The project is still very early days, however the general outline of using this
214
214
215
215
You can then use Swift libraries in Java just by calling the appropriate methods and initializers.
216
216
217
+
#### Enable Java Callbacks Mode
218
+
219
+
> **NOTE**: This feature requires disabling the SwiftPM Sandbox and is only supported in 'jni' mode.
220
+
221
+
The `enableJavaCallbacks` mode is an advanced feature that allows Java classes to implement Swift protocols. When enabled, JExtract generates additional Java interface wrappers that enable bidirectional interoperability - not only can Java code call Swift functions, but Java classes can also implement Swift protocols and be passed back to Swift.
222
+
223
+
**Key characteristics:**
224
+
-**Mode restriction**: Only available in JNI mode (will throw an error if used with FFM mode)
225
+
-**Sandbox requirement**: Requires disabling SwiftPM sandbox (`--disable-sandbox` or equivalent)
226
+
-**Protocol implementation**: Enables Java classes to implement Swift protocols
227
+
-**Bidirectional communication**: Allows callbacks from Swift back to Java implementations
0 commit comments