File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed File renamed without changes.
Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ import JavaRuntime
61
61
62
62
@JavaClass (" org.swift.javakit.HelloSwiftMain" )
63
63
struct HelloSwiftMain {
64
- @ExposeToJava
64
+ @ImplementsJava
65
65
static func main (arguments : [String ], environment : JNIEnvironment) {
66
66
print (" Command line arguments are: \( arguments ) " )
67
67
}
@@ -94,7 +94,7 @@ struct HelloSwiftMain: ParsableCommand {
94
94
@Option (name: .shortAndLong , help: " Enable verbose output" )
95
95
var verbose: Bool = false
96
96
97
- @ExposeToJava
97
+ @ImplementsJava
98
98
static func main (arguments : [String ], environment : JNIEnvironment) {
99
99
let command = Self .parseOrExit (arguments)
100
100
command.run (environment : environment)
@@ -322,12 +322,12 @@ struct HelloSwift { ... }
322
322
```
323
323
324
324
Implementations of ` native ` methods can be written within the Swift type or an
325
- extension thereof, and should be marked with ` @ExposeToJava ` . For example:
325
+ extension thereof, and should be marked with ` @ImplementsJava ` . For example:
326
326
327
327
``` swift
328
328
@JavaClass (" org.swift.javakit.HelloSwift" )
329
329
extension HelloSwift {
330
- @ExposeToJava
330
+ @ImplementsJava
331
331
func reportStatistics (_ meaning : String , _ numbers : [Double ]) -> String {
332
332
let average = numbers.isEmpty ? 0.0 : numbers.reduce (0.0 ) { $0 + $1 } / Double (numbers.count )
333
333
return " Average of \( meaning ) is \( average ) "
You can’t perform that action at this time.
0 commit comments