Skip to content

Commit 12bc2e5

Browse files
authored
Refactor @ExposeToJava to @ImplementsJava in the USER_GUIDE (#11)
1 parent 87f701a commit 12bc2e5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

USER_GUIDE.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ import JavaRuntime
6161

6262
@JavaClass("org.swift.javakit.HelloSwiftMain")
6363
struct HelloSwiftMain {
64-
@ExposeToJava
64+
@ImplementsJava
6565
static func main(arguments: [String], environment: JNIEnvironment) {
6666
print("Command line arguments are: \(arguments)")
6767
}
@@ -94,7 +94,7 @@ struct HelloSwiftMain: ParsableCommand {
9494
@Option(name: .shortAndLong, help: "Enable verbose output")
9595
var verbose: Bool = false
9696

97-
@ExposeToJava
97+
@ImplementsJava
9898
static func main(arguments: [String], environment: JNIEnvironment) {
9999
let command = Self.parseOrExit(arguments)
100100
command.run(environment: environment)
@@ -322,12 +322,12 @@ struct HelloSwift { ... }
322322
```
323323

324324
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:
326326

327327
```swift
328328
@JavaClass("org.swift.javakit.HelloSwift")
329329
extension HelloSwift {
330-
@ExposeToJava
330+
@ImplementsJava
331331
func reportStatistics(_ meaning: String, _ numbers: [Double]) -> String {
332332
let average = numbers.isEmpty ? 0.0 : numbers.reduce(0.0) { $0 + $1 } / Double(numbers.count)
333333
return "Average of \(meaning) is \(average)"

0 commit comments

Comments
 (0)