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
+17-89Lines changed: 17 additions & 89 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -214,105 +214,33 @@ 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
217
+
### Enable Java Callbacks Mode
218
218
219
-
> **NOTE**: This feature requires disabling the SwiftPM Sandbox and is only supported in 'jni' mode.
219
+
> **Note**
220
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.
221
+
---
222
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
- Performance overhead compared to direct JNI calls
308
-
- Limited to protocol methods (not all Swift features)
309
-
310
-
**When to use:**
311
-
- When you need Java classes to implement Swift protocols
312
-
- For event-driven architectures where Swift needs to call back into Java
313
-
- When building hybrid applications that require tight integration between languages
314
-
315
-
For a complete working example, see `Samples/SwiftJavaExtractJNISampleApp` which demonstrates this feature in action.
316
244
317
245
### Generating Java bindings for Swift libraries
318
246
@@ -364,4 +292,4 @@ You can refer to the `SwiftJavaConfigurationShared/Configuration` struct to lear
364
292
Configuration from the config files may be overriden or augmented by explicit command line parameters,
365
293
please refer to the options documentation for details on their behavior.
366
294
367
-
> Note: **Comments in configuration**: The configuration is a JSON 5 file, which among other things allows `//` and `/* */` comments, so feel free to add line comments explaining rationale for some of the settings in youf configuration.
295
+
> Note: **Comments in configuration**: The configuration is a JSON 5 file, which among other things allows `//` and `/* */` comments, so feel free to add line comments explaining rationale for some of the settings in youf configuration.
0 commit comments