-
Notifications
You must be signed in to change notification settings - Fork 13
/
JavaObject.swift
194 lines (139 loc) · 8.17 KB
/
JavaObject.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
/// generated by: genswift.java 'java/lang|java/util|java/sql|java/awt|javax/swing' ///
/// class java.lang.Object ///
open class JavaObject: JNIObject {
public convenience init?( casting object: JavaObject, _ file: StaticString = #file, _ line: Int = #line ) {
self.init( javaObject: nil )
object.withJavaObject {
self.javaObject = $0
}
}
private static var JavaObjectJNIClass: jclass?
/// public java.lang.Object()
private static var new_MethodID_1: jmethodID?
public convenience init() {
var __locals = [jobject]()
var __args = [jvalue]( repeating: jvalue(), count: 1 )
let __object = JNIMethod.NewObject( className: "java/lang/Object", classCache: &JavaObject.JavaObjectJNIClass, methodSig: "()V", methodCache: &JavaObject.new_MethodID_1, args: &__args, locals: &__locals )
self.init( javaObject: __object )
JNI.DeleteLocalRef( __object )
}
/// private static native void java.lang.Object.registerNatives()
/// protected native java.lang.Object java.lang.Object.clone() throws java.lang.CloneNotSupportedException
private static var clone_MethodID_2: jmethodID?
open func clone() throws /* java.lang.CloneNotSupportedException */ -> JavaObject! {
var __locals = [jobject]()
var __args = [jvalue]( repeating: jvalue(), count: 1 )
let __return = JNIMethod.CallObjectMethod( object: javaObject, methodName: "clone", methodSig: "()Ljava/lang/Object;", methodCache: &JavaObject.clone_MethodID_2, args: &__args, locals: &__locals )
defer { JNI.DeleteLocalRef( __return ) }
if let throwable = JNI.ExceptionCheck() {
defer { JNI.DeleteLocalRef( throwable ) }
throw /* class java.lang.CloneNotSupportedException */ UnavailableObject( javaObject: throwable )
}
return __return != nil ? JavaObject( javaObject: __return ) : nil
}
/// public boolean java.lang.Object.equals(java.lang.Object)
private static var equals_MethodID_3: jmethodID?
open func equals( arg0: JavaObject? ) -> Bool {
var __locals = [jobject]()
var __args = [jvalue]( repeating: jvalue(), count: 1 )
__args[0] = JNIType.toJava( value: arg0, locals: &__locals )
let __return = JNIMethod.CallBooleanMethod( object: javaObject, methodName: "equals", methodSig: "(Ljava/lang/Object;)Z", methodCache: &JavaObject.equals_MethodID_3, args: &__args, locals: &__locals )
return __return != jboolean(JNI_FALSE)
}
open func equals( _ _arg0: JavaObject? ) -> Bool {
return equals( arg0: _arg0 )
}
/// protected void java.lang.Object.finalize() throws java.lang.Throwable
private static var finalize_MethodID_4: jmethodID?
open func finalize() throws /* java.lang.Throwable */ {
var __locals = [jobject]()
var __args = [jvalue]( repeating: jvalue(), count: 1 )
JNIMethod.CallVoidMethod( object: javaObject, methodName: "finalize", methodSig: "()V", methodCache: &JavaObject.finalize_MethodID_4, args: &__args, locals: &__locals )
if let throwable = JNI.ExceptionCheck() {
defer { JNI.DeleteLocalRef( throwable ) }
throw Throwable( javaObject: throwable )
}
}
/// public final native java.lang.Class java.lang.Object.getClass()
private static var getClass_MethodID_5: jmethodID?
open func getClass() -> JavaClass! {
var __locals = [jobject]()
var __args = [jvalue]( repeating: jvalue(), count: 1 )
let __return = JNIMethod.CallObjectMethod( object: javaObject, methodName: "getClass", methodSig: "()Ljava/lang/Class;", methodCache: &JavaObject.getClass_MethodID_5, args: &__args, locals: &__locals )
defer { JNI.DeleteLocalRef( __return ) }
return __return != nil ? JavaClass( javaObject: __return ) : nil
}
/// public native int java.lang.Object.hashCode()
private static var hashCode_MethodID_6: jmethodID?
open func hashCode() -> Int {
var __locals = [jobject]()
var __args = [jvalue]( repeating: jvalue(), count: 1 )
let __return = JNIMethod.CallIntMethod( object: javaObject, methodName: "hashCode", methodSig: "()I", methodCache: &JavaObject.hashCode_MethodID_6, args: &__args, locals: &__locals )
return Int(__return)
}
/// public final native void java.lang.Object.notify()
private static var notify_MethodID_7: jmethodID?
open func notify() {
var __locals = [jobject]()
var __args = [jvalue]( repeating: jvalue(), count: 1 )
JNIMethod.CallVoidMethod( object: javaObject, methodName: "notify", methodSig: "()V", methodCache: &JavaObject.notify_MethodID_7, args: &__args, locals: &__locals )
}
/// public final native void java.lang.Object.notifyAll()
private static var notifyAll_MethodID_8: jmethodID?
open func notifyAll() {
var __locals = [jobject]()
var __args = [jvalue]( repeating: jvalue(), count: 1 )
JNIMethod.CallVoidMethod( object: javaObject, methodName: "notifyAll", methodSig: "()V", methodCache: &JavaObject.notifyAll_MethodID_8, args: &__args, locals: &__locals )
}
/// public java.lang.String java.lang.Object.toString()
private static var toString_MethodID_9: jmethodID?
open func toString() -> String! {
var __locals = [jobject]()
var __args = [jvalue]( repeating: jvalue(), count: 1 )
let __return = JNIMethod.CallObjectMethod( object: javaObject, methodName: "toString", methodSig: "()Ljava/lang/String;", methodCache: &JavaObject.toString_MethodID_9, args: &__args, locals: &__locals )
defer { JNI.DeleteLocalRef( __return ) }
return __return != nil ? String( javaObject: __return ) : nil
}
/// public final native void java.lang.Object.wait(long) throws java.lang.InterruptedException
private static var wait_MethodID_10: jmethodID?
open func wait( arg0: Int64 ) throws /* java.lang.InterruptedException */ {
var __locals = [jobject]()
var __args = [jvalue]( repeating: jvalue(), count: 1 )
__args[0] = jvalue( j: arg0 )
JNIMethod.CallVoidMethod( object: javaObject, methodName: "wait", methodSig: "(J)V", methodCache: &JavaObject.wait_MethodID_10, args: &__args, locals: &__locals )
if let throwable = JNI.ExceptionCheck() {
defer { JNI.DeleteLocalRef( throwable ) }
throw /* class java.lang.InterruptedException */ UnavailableObject( javaObject: throwable )
}
}
open func wait( _ _arg0: Int64 ) throws /* java.lang.InterruptedException */ {
try wait( arg0: _arg0 )
}
/// public final void java.lang.Object.wait(long,int) throws java.lang.InterruptedException
private static var wait_MethodID_11: jmethodID?
open func wait( arg0: Int64, arg1: Int ) throws /* java.lang.InterruptedException */ {
var __locals = [jobject]()
var __args = [jvalue]( repeating: jvalue(), count: 2 )
__args[0] = jvalue( j: arg0 )
__args[1] = jvalue( i: jint(arg1) )
JNIMethod.CallVoidMethod( object: javaObject, methodName: "wait", methodSig: "(JI)V", methodCache: &JavaObject.wait_MethodID_11, args: &__args, locals: &__locals )
if let throwable = JNI.ExceptionCheck() {
defer { JNI.DeleteLocalRef( throwable ) }
throw /* class java.lang.InterruptedException */ UnavailableObject( javaObject: throwable )
}
}
open func wait( _ _arg0: Int64, _ _arg1: Int ) throws /* java.lang.InterruptedException */ {
try wait( arg0: _arg0, arg1: _arg1 )
}
/// public final void java.lang.Object.wait() throws java.lang.InterruptedException
private static var wait_MethodID_12: jmethodID?
open func wait() throws /* java.lang.InterruptedException */ {
var __locals = [jobject]()
var __args = [jvalue]( repeating: jvalue(), count: 1 )
JNIMethod.CallVoidMethod( object: javaObject, methodName: "wait", methodSig: "()V", methodCache: &JavaObject.wait_MethodID_12, args: &__args, locals: &__locals )
if let throwable = JNI.ExceptionCheck() {
defer { JNI.DeleteLocalRef( throwable ) }
throw /* class java.lang.InterruptedException */ UnavailableObject( javaObject: throwable )
}
}
}