diff --git a/Sources/JavaStdlib/JavaLangReflect/JavaClass+Reflection.swift b/Sources/JavaStdlib/JavaLangReflect/JavaClass+Reflection.swift index 29e24be5..49e93ee3 100644 --- a/Sources/JavaStdlib/JavaLangReflect/JavaClass+Reflection.swift +++ b/Sources/JavaStdlib/JavaLangReflect/JavaClass+Reflection.swift @@ -32,6 +32,12 @@ extension JavaClass { @JavaMethod public func getFields() -> [Field?] + @JavaMethod + public func getGenericInterfaces() -> [Type?] + + @JavaMethod + public func getGenericSuperclass() -> Type! + @JavaMethod public func getConstructors() -> [Constructor?] @@ -41,9 +47,6 @@ extension JavaClass { @JavaMethod public func getTypeParameters() -> [TypeVariable>?] - @JavaMethod - public func getGenericInterfaces() -> [Type?] - @JavaMethod public func getAnnotations() -> [Annotation?] } diff --git a/Sources/JavaStdlib/JavaLangReflect/generated/Array.swift b/Sources/JavaStdlib/JavaLangReflect/generated/Array.swift new file mode 100644 index 00000000..ba7c88e5 --- /dev/null +++ b/Sources/JavaStdlib/JavaLangReflect/generated/Array.swift @@ -0,0 +1,198 @@ +// Auto-generated by Java-to-Swift wrapper generator. +import SwiftJava +import SwiftJavaJNICore + +@JavaClass("java.lang.reflect.Array") +open class Array: JavaObject { + +} +extension JavaClass { + /// Java method `get`. + /// + /// ### Java method signature + /// ```java + /// public static native java.lang.Object java.lang.reflect.Array.get(java.lang.Object,int) throws java.lang.IllegalArgumentException,java.lang.ArrayIndexOutOfBoundsException + /// ``` + @JavaStaticMethod + public func get(_ arg0: JavaObject?, _ arg1: Int32) throws -> JavaObject! + + /// Java method `getLength`. + /// + /// ### Java method signature + /// ```java + /// public static native int java.lang.reflect.Array.getLength(java.lang.Object) throws java.lang.IllegalArgumentException + /// ``` + @JavaStaticMethod + public func getLength(_ arg0: JavaObject?) throws -> Int32 + + /// Java method `getBoolean`. + /// + /// ### Java method signature + /// ```java + /// public static native boolean java.lang.reflect.Array.getBoolean(java.lang.Object,int) throws java.lang.IllegalArgumentException,java.lang.ArrayIndexOutOfBoundsException + /// ``` + @JavaStaticMethod + public func getBoolean(_ arg0: JavaObject?, _ arg1: Int32) throws -> Bool + + /// Java method `getByte`. + /// + /// ### Java method signature + /// ```java + /// public static native byte java.lang.reflect.Array.getByte(java.lang.Object,int) throws java.lang.IllegalArgumentException,java.lang.ArrayIndexOutOfBoundsException + /// ``` + @JavaStaticMethod + public func getByte(_ arg0: JavaObject?, _ arg1: Int32) throws -> Int8 + + /// Java method `getShort`. + /// + /// ### Java method signature + /// ```java + /// public static native short java.lang.reflect.Array.getShort(java.lang.Object,int) throws java.lang.IllegalArgumentException,java.lang.ArrayIndexOutOfBoundsException + /// ``` + @JavaStaticMethod + public func getShort(_ arg0: JavaObject?, _ arg1: Int32) throws -> Int16 + + /// Java method `getChar`. + /// + /// ### Java method signature + /// ```java + /// public static native char java.lang.reflect.Array.getChar(java.lang.Object,int) throws java.lang.IllegalArgumentException,java.lang.ArrayIndexOutOfBoundsException + /// ``` + @JavaStaticMethod + public func getChar(_ arg0: JavaObject?, _ arg1: Int32) throws -> UInt16 + + /// Java method `getInt`. + /// + /// ### Java method signature + /// ```java + /// public static native int java.lang.reflect.Array.getInt(java.lang.Object,int) throws java.lang.IllegalArgumentException,java.lang.ArrayIndexOutOfBoundsException + /// ``` + @JavaStaticMethod + public func getInt(_ arg0: JavaObject?, _ arg1: Int32) throws -> Int32 + + /// Java method `getLong`. + /// + /// ### Java method signature + /// ```java + /// public static native long java.lang.reflect.Array.getLong(java.lang.Object,int) throws java.lang.IllegalArgumentException,java.lang.ArrayIndexOutOfBoundsException + /// ``` + @JavaStaticMethod + public func getLong(_ arg0: JavaObject?, _ arg1: Int32) throws -> Int64 + + /// Java method `getFloat`. + /// + /// ### Java method signature + /// ```java + /// public static native float java.lang.reflect.Array.getFloat(java.lang.Object,int) throws java.lang.IllegalArgumentException,java.lang.ArrayIndexOutOfBoundsException + /// ``` + @JavaStaticMethod + public func getFloat(_ arg0: JavaObject?, _ arg1: Int32) throws -> Float + + /// Java method `getDouble`. + /// + /// ### Java method signature + /// ```java + /// public static native double java.lang.reflect.Array.getDouble(java.lang.Object,int) throws java.lang.IllegalArgumentException,java.lang.ArrayIndexOutOfBoundsException + /// ``` + @JavaStaticMethod + public func getDouble(_ arg0: JavaObject?, _ arg1: Int32) throws -> Double + + /// Java method `newInstance`. + /// + /// ### Java method signature + /// ```java + /// public static java.lang.Object java.lang.reflect.Array.newInstance(java.lang.Class,int) throws java.lang.NegativeArraySizeException + /// ``` + @JavaStaticMethod + public func newInstance(_ arg0: JavaClass?, _ arg1: Int32) throws -> JavaObject! + + /// Java method `newInstance`. + /// + /// ### Java method signature + /// ```java + /// public static java.lang.Object java.lang.reflect.Array.newInstance(java.lang.Class,int...) throws java.lang.IllegalArgumentException,java.lang.NegativeArraySizeException + /// ``` + @JavaStaticMethod + public func newInstance(_ arg0: JavaClass?, _ arg1: [Int32]) throws -> JavaObject! + + /// Java method `set`. + /// + /// ### Java method signature + /// ```java + /// public static native void java.lang.reflect.Array.set(java.lang.Object,int,java.lang.Object) throws java.lang.IllegalArgumentException,java.lang.ArrayIndexOutOfBoundsException + /// ``` + @JavaStaticMethod + public func set(_ arg0: JavaObject?, _ arg1: Int32, _ arg2: JavaObject?) throws + + /// Java method `setBoolean`. + /// + /// ### Java method signature + /// ```java + /// public static native void java.lang.reflect.Array.setBoolean(java.lang.Object,int,boolean) throws java.lang.IllegalArgumentException,java.lang.ArrayIndexOutOfBoundsException + /// ``` + @JavaStaticMethod + public func setBoolean(_ arg0: JavaObject?, _ arg1: Int32, _ arg2: Bool) throws + + /// Java method `setByte`. + /// + /// ### Java method signature + /// ```java + /// public static native void java.lang.reflect.Array.setByte(java.lang.Object,int,byte) throws java.lang.IllegalArgumentException,java.lang.ArrayIndexOutOfBoundsException + /// ``` + @JavaStaticMethod + public func setByte(_ arg0: JavaObject?, _ arg1: Int32, _ arg2: Int8) throws + + /// Java method `setChar`. + /// + /// ### Java method signature + /// ```java + /// public static native void java.lang.reflect.Array.setChar(java.lang.Object,int,char) throws java.lang.IllegalArgumentException,java.lang.ArrayIndexOutOfBoundsException + /// ``` + @JavaStaticMethod + public func setChar(_ arg0: JavaObject?, _ arg1: Int32, _ arg2: UInt16) throws + + /// Java method `setShort`. + /// + /// ### Java method signature + /// ```java + /// public static native void java.lang.reflect.Array.setShort(java.lang.Object,int,short) throws java.lang.IllegalArgumentException,java.lang.ArrayIndexOutOfBoundsException + /// ``` + @JavaStaticMethod + public func setShort(_ arg0: JavaObject?, _ arg1: Int32, _ arg2: Int16) throws + + /// Java method `setInt`. + /// + /// ### Java method signature + /// ```java + /// public static native void java.lang.reflect.Array.setInt(java.lang.Object,int,int) throws java.lang.IllegalArgumentException,java.lang.ArrayIndexOutOfBoundsException + /// ``` + @JavaStaticMethod + public func setInt(_ arg0: JavaObject?, _ arg1: Int32, _ arg2: Int32) throws + + /// Java method `setLong`. + /// + /// ### Java method signature + /// ```java + /// public static native void java.lang.reflect.Array.setLong(java.lang.Object,int,long) throws java.lang.IllegalArgumentException,java.lang.ArrayIndexOutOfBoundsException + /// ``` + @JavaStaticMethod + public func setLong(_ arg0: JavaObject?, _ arg1: Int32, _ arg2: Int64) throws + + /// Java method `setFloat`. + /// + /// ### Java method signature + /// ```java + /// public static native void java.lang.reflect.Array.setFloat(java.lang.Object,int,float) throws java.lang.IllegalArgumentException,java.lang.ArrayIndexOutOfBoundsException + /// ``` + @JavaStaticMethod + public func setFloat(_ arg0: JavaObject?, _ arg1: Int32, _ arg2: Float) throws + + /// Java method `setDouble`. + /// + /// ### Java method signature + /// ```java + /// public static native void java.lang.reflect.Array.setDouble(java.lang.Object,int,double) throws java.lang.IllegalArgumentException,java.lang.ArrayIndexOutOfBoundsException + /// ``` + @JavaStaticMethod + public func setDouble(_ arg0: JavaObject?, _ arg1: Int32, _ arg2: Double) throws +} diff --git a/Sources/JavaStdlib/JavaLangReflect/swift-java.config b/Sources/JavaStdlib/JavaLangReflect/swift-java.config index 98eb4cd8..b4d96403 100644 --- a/Sources/JavaStdlib/JavaLangReflect/swift-java.config +++ b/Sources/JavaStdlib/JavaLangReflect/swift-java.config @@ -3,6 +3,7 @@ "java.lang.annotation.Annotation" : "Annotation", "java.lang.reflect.AccessibleObject" : "AccessibleObject", "java.lang.reflect.AnnotatedType" : "AnnotatedType", + "java.lang.reflect.Array" : "Array", "java.lang.reflect.Constructor" : "Constructor", "java.lang.reflect.Executable" : "Executable", "java.lang.reflect.Field" : "Field", diff --git a/Sources/SwiftJava/generated/JavaClass.swift b/Sources/SwiftJava/generated/JavaClass.swift index be475227..e74c22e6 100644 --- a/Sources/SwiftJava/generated/JavaClass.swift +++ b/Sources/SwiftJava/generated/JavaClass.swift @@ -1,159 +1,466 @@ // Auto-generated by Java-to-Swift wrapper generator. import SwiftJavaJNICore -@JavaClass("java.lang.Class", implements: JavaReflectType.self) +@JavaClass("java.lang.Class") open class JavaClass: JavaObject { + /// Java method `getName`. + /// + /// ### Java method signature + /// ```java + /// public java.lang.String java.lang.Class.getName() + /// ``` @JavaMethod open func getName() -> String + /// Java method `toString`. + /// + /// ### Java method signature + /// ```java + /// public java.lang.String java.lang.Class.toString() + /// ``` @JavaMethod open override func toString() -> String + /// Java method `isAssignableFrom`. + /// + /// ### Java method signature + /// ```java + /// public native boolean java.lang.Class.isAssignableFrom(java.lang.Class) + /// ``` @JavaMethod open func isAssignableFrom(_ arg0: JavaClass?) -> Bool + /// Java method `isInstance`. + /// + /// ### Java method signature + /// ```java + /// public native boolean java.lang.Class.isInstance(java.lang.Object) + /// ``` @JavaMethod open func isInstance(_ arg0: JavaObject?) -> Bool + /// Java method `isHidden`. + /// + /// ### Java method signature + /// ```java + /// public native boolean java.lang.Class.isHidden() + /// ``` @JavaMethod - open func getModifiers() -> Int32 - - @JavaMethod - open func isInterface() -> Bool + open func isHidden() -> Bool + /// Java method `getSuperclass`. + /// + /// ### Java method signature + /// ```java + /// public native java.lang.Class java.lang.Class.getSuperclass() + /// ``` @JavaMethod - open func isArray() -> Bool + open func getSuperclass() -> JavaClass! + /// Java method `cast`. + /// + /// ### Java method signature + /// ```java + /// public T java.lang.Class.cast(java.lang.Object) + /// ``` + @JavaMethod(typeErasedResult: "T!") + open func cast(_ arg0: JavaObject?) -> T! + + /// Java method `componentType`. + /// + /// ### Java method signature + /// ```java + /// public java.lang.Class java.lang.Class.componentType() + /// ``` @JavaMethod - open func isPrimitive() -> Bool + open func componentType() -> JavaClass! + /// Java method `isInterface`. + /// + /// ### Java method signature + /// ```java + /// public boolean java.lang.Class.isInterface() + /// ``` @JavaMethod - open func isHidden() -> Bool + open func isInterface() -> Bool + /// Java method `isPrimitive`. + /// + /// ### Java method signature + /// ```java + /// public boolean java.lang.Class.isPrimitive() + /// ``` @JavaMethod - open func getSuperclass() -> JavaClass! + open func isPrimitive() -> Bool + /// Java method `isArray`. + /// + /// ### Java method signature + /// ```java + /// public boolean java.lang.Class.isArray() + /// ``` @JavaMethod - open func cast(_ arg0: JavaObject?) -> JavaObject! + open func isArray() -> Bool + /// Java method `getComponentType`. + /// + /// ### Java method signature + /// ```java + /// public java.lang.Class java.lang.Class.getComponentType() + /// ``` @JavaMethod - open func componentType() -> JavaClass! + open func getComponentType() -> JavaClass! + /// Java method `getModifiers`. + /// + /// ### Java method signature + /// ```java + /// public int java.lang.Class.getModifiers() + /// ``` @JavaMethod - open func getComponentType() -> JavaClass! + open func getModifiers() -> Int32 + /// Java method `isAnnotation`. + /// + /// ### Java method signature + /// ```java + /// public boolean java.lang.Class.isAnnotation() + /// ``` @JavaMethod open func isAnnotation() -> Bool + /// Java method `isEnum`. + /// + /// ### Java method signature + /// ```java + /// public boolean java.lang.Class.isEnum() + /// ``` @JavaMethod open func isEnum() -> Bool + /// Java method `isRecord`. + /// + /// ### Java method signature + /// ```java + /// public boolean java.lang.Class.isRecord() + /// ``` @JavaMethod open func isRecord() -> Bool + /// Java method `isSealed`. + /// + /// ### Java method signature + /// ```java + /// public boolean java.lang.Class.isSealed() + /// ``` @JavaMethod open func isSealed() -> Bool + /// Java method `getInterfaces`. + /// + /// ### Java method signature + /// ```java + /// public java.lang.Class[] java.lang.Class.getInterfaces() + /// ``` @JavaMethod open func getInterfaces() -> [JavaClass?] + /// Java method `getClassLoader`. + /// + /// ### Java method signature + /// ```java + /// public java.lang.ClassLoader java.lang.Class.getClassLoader() + /// ``` @JavaMethod open func getClassLoader() -> JavaClassLoader! - @JavaMethod + /// Java method `newInstance`. + /// + /// ### Java method signature + /// ```java + /// public T java.lang.Class.newInstance() throws java.lang.InstantiationException,java.lang.IllegalAccessException + /// ``` + @available(*, deprecated) + @JavaMethod(typeErasedResult: "T!") open func newInstance() throws -> T! + /// Java method `isMemberClass`. + /// + /// ### Java method signature + /// ```java + /// public boolean java.lang.Class.isMemberClass() + /// ``` @JavaMethod open func isMemberClass() -> Bool + /// Java method `isLocalClass`. + /// + /// ### Java method signature + /// ```java + /// public boolean java.lang.Class.isLocalClass() + /// ``` @JavaMethod open func isLocalClass() -> Bool + /// Java method `isAnonymousClass`. + /// + /// ### Java method signature + /// ```java + /// public boolean java.lang.Class.isAnonymousClass() + /// ``` @JavaMethod open func isAnonymousClass() -> Bool + /// Java method `getEnclosingClass`. + /// + /// ### Java method signature + /// ```java + /// public java.lang.Class java.lang.Class.getEnclosingClass() + /// ``` @JavaMethod open func getEnclosingClass() -> JavaClass! + /// Java method `arrayType`. + /// + /// ### Java method signature + /// ```java + /// public java.lang.Class java.lang.Class.arrayType() + /// ``` @JavaMethod open func arrayType() -> JavaClass! + /// Java method `getSimpleName`. + /// + /// ### Java method signature + /// ```java + /// public java.lang.String java.lang.Class.getSimpleName() + /// ``` @JavaMethod open func getSimpleName() -> String + /// Java method `getCanonicalName`. + /// + /// ### Java method signature + /// ```java + /// public java.lang.String java.lang.Class.getCanonicalName() + /// ``` @JavaMethod open func getCanonicalName() -> String + /// Java method `getDeclaredClasses`. + /// + /// ### Java method signature + /// ```java + /// public java.lang.Class[] java.lang.Class.getDeclaredClasses() + /// ``` @JavaMethod open func getDeclaredClasses() -> [JavaClass?] + /// Java method `getResourceAsStream`. + /// + /// ### Java method signature + /// ```java + /// public java.io.InputStream java.lang.Class.getResourceAsStream(java.lang.String) + /// ``` + @JavaMethod + open func getResourceAsStream(_ arg0: String) -> InputStream! + + /// Java method `getPackageName`. + /// + /// ### Java method signature + /// ```java + /// public java.lang.String java.lang.Class.getPackageName() + /// ``` @JavaMethod open func getPackageName() -> String + /// Java method `desiredAssertionStatus`. + /// + /// ### Java method signature + /// ```java + /// public boolean java.lang.Class.desiredAssertionStatus() + /// ``` @JavaMethod open func desiredAssertionStatus() -> Bool + /// Java method `getNestHost`. + /// + /// ### Java method signature + /// ```java + /// public java.lang.Class java.lang.Class.getNestHost() + /// ``` @JavaMethod open func getNestHost() -> JavaClass! + /// Java method `descriptorString`. + /// + /// ### Java method signature + /// ```java + /// public java.lang.String java.lang.Class.descriptorString() + /// ``` @JavaMethod open func descriptorString() -> String + /// Java method `getPermittedSubclasses`. + /// + /// ### Java method signature + /// ```java + /// public java.lang.Class[] java.lang.Class.getPermittedSubclasses() + /// ``` @JavaMethod open func getPermittedSubclasses() -> [JavaClass?] + /// Java method `toGenericString`. + /// + /// ### Java method signature + /// ```java + /// public java.lang.String java.lang.Class.toGenericString() + /// ``` @JavaMethod open func toGenericString() -> String + /// Java method `isSynthetic`. + /// + /// ### Java method signature + /// ```java + /// public boolean java.lang.Class.isSynthetic() + /// ``` @JavaMethod open func isSynthetic() -> Bool - @JavaMethod - open func getGenericSuperclass() -> JavaReflectType! - - @JavaMethod - open func getGenericInterfaces() -> [JavaReflectType?] - + /// Java method `getSigners`. + /// + /// ### Java method signature + /// ```java + /// public java.lang.Object[] java.lang.Class.getSigners() + /// ``` @JavaMethod open func getSigners() -> [JavaObject?] + /// Java method `getDeclaringClass`. + /// + /// ### Java method signature + /// ```java + /// public java.lang.Class java.lang.Class.getDeclaringClass() + /// ``` @JavaMethod open func getDeclaringClass() -> JavaClass! + /// Java method `getTypeName`. + /// + /// ### Java method signature + /// ```java + /// public java.lang.String java.lang.Class.getTypeName() + /// ``` @JavaMethod open func getTypeName() -> String + /// Java method `getClasses`. + /// + /// ### Java method signature + /// ```java + /// public java.lang.Class[] java.lang.Class.getClasses() + /// ``` @JavaMethod open func getClasses() -> [JavaClass?] - @JavaMethod - open func getEnumConstants() -> [JavaObject?] - - @JavaMethod - open func asSubclass(_ arg0: JavaClass?) -> JavaClass! - + /// Java method `getEnumConstants`. + /// + /// ### Java method signature + /// ```java + /// public T[] java.lang.Class.getEnumConstants() + /// ``` + @JavaMethod + open func getEnumConstants() -> [T?] + + /// Java method `asSubclass`. + /// + /// ### Java method signature + /// ```java + /// public java.lang.Class java.lang.Class.asSubclass(java.lang.Class) + /// ``` + @JavaMethod + open func asSubclass(_ arg0: JavaClass?) -> JavaClass! + + /// Java method `getAnnotation`. + /// + /// ### Java method signature + /// ```java + /// public A java.lang.Class.getAnnotation(java.lang.Class) + /// ``` + @JavaMethod(typeErasedResult: "A!") + open func getAnnotation(_ arg0: JavaClass?) -> A! + + /// Java method `getAnnotationsByType`. + /// + /// ### Java method signature + /// ```java + /// public A[] java.lang.Class.getAnnotationsByType(java.lang.Class) + /// ``` + @JavaMethod + open func getAnnotationsByType(_ arg0: JavaClass?) -> [A?] + + /// Java method `getDeclaredAnnotation`. + /// + /// ### Java method signature + /// ```java + /// public A java.lang.Class.getDeclaredAnnotation(java.lang.Class) + /// ``` + @JavaMethod(typeErasedResult: "A!") + open func getDeclaredAnnotation(_ arg0: JavaClass?) -> A! + + /// Java method `getDeclaredAnnotationsByType`. + /// + /// ### Java method signature + /// ```java + /// public A[] java.lang.Class.getDeclaredAnnotationsByType(java.lang.Class) + /// ``` + @JavaMethod + open func getDeclaredAnnotationsByType(_ arg0: JavaClass?) -> [A?] + + /// Java method `isNestmateOf`. + /// + /// ### Java method signature + /// ```java + /// public boolean java.lang.Class.isNestmateOf(java.lang.Class) + /// ``` @JavaMethod open func isNestmateOf(_ arg0: JavaClass?) -> Bool + /// Java method `getNestMembers`. + /// + /// ### Java method signature + /// ```java + /// public java.lang.Class[] java.lang.Class.getNestMembers() + /// ``` @JavaMethod open func getNestMembers() -> [JavaClass?] - - @JavaMethod - open func getResourceAsStream(_ arg0: String) -> InputStream! } extension JavaClass { + /// Java method `forName`. + /// + /// ### Java method signature + /// ```java + /// public static java.lang.Class java.lang.Class.forName(java.lang.String) throws java.lang.ClassNotFoundException + /// ``` @JavaStaticMethod - public func forName(_ arg0: String) throws -> JavaClass! - where ObjectType == JavaClass - + public func forName(_ arg0: String) throws -> JavaClass! where ObjectType == JavaClass + + /// Java method `forName`. + /// + /// ### Java method signature + /// ```java + /// public static java.lang.Class java.lang.Class.forName(java.lang.String,boolean,java.lang.ClassLoader) throws java.lang.ClassNotFoundException + /// ``` @JavaStaticMethod - public func forName( - _ arg0: String, - _ arg1: Bool, - _ arg2: JavaClassLoader? - ) throws -> JavaClass! where ObjectType == JavaClass - + public func forName(_ arg0: String, _ arg1: Bool, _ arg2: JavaClassLoader?) throws -> JavaClass! where ObjectType == JavaClass + + /// Java method `forPrimitiveName`. + /// + /// ### Java method signature + /// ```java + /// public static java.lang.Class java.lang.Class.forPrimitiveName(java.lang.String) + /// ``` @JavaStaticMethod - public func forPrimitiveName(_ arg0: String) -> JavaClass! - where ObjectType == JavaClass + public func forPrimitiveName(_ arg0: String) -> JavaClass! where ObjectType == JavaClass } diff --git a/Sources/SwiftJava/generated/JavaReflectArray.swift b/Sources/SwiftJava/generated/JavaReflectArray.swift deleted file mode 100644 index 851005a7..00000000 --- a/Sources/SwiftJava/generated/JavaReflectArray.swift +++ /dev/null @@ -1,71 +0,0 @@ -// Auto-generated by Java-to-Swift wrapper generator. -import SwiftJavaJNICore - -@JavaClass("java.lang.reflect.Array") -open class JavaReflectArray: JavaObject { - -} -extension JavaClass { - @JavaStaticMethod - public func get(_ arg0: JavaObject?, _ arg1: Int32) throws -> JavaObject! - - @JavaStaticMethod - public func getLength(_ arg0: JavaObject?) throws -> Int32 - - @JavaStaticMethod - public func getBoolean(_ arg0: JavaObject?, _ arg1: Int32) throws -> Bool - - @JavaStaticMethod - public func getByte(_ arg0: JavaObject?, _ arg1: Int32) throws -> Int8 - - @JavaStaticMethod - public func getShort(_ arg0: JavaObject?, _ arg1: Int32) throws -> Int16 - - @JavaStaticMethod - public func getChar(_ arg0: JavaObject?, _ arg1: Int32) throws -> UInt16 - - @JavaStaticMethod - public func getInt(_ arg0: JavaObject?, _ arg1: Int32) throws -> Int32 - - @JavaStaticMethod - public func getLong(_ arg0: JavaObject?, _ arg1: Int32) throws -> Int64 - - @JavaStaticMethod - public func getFloat(_ arg0: JavaObject?, _ arg1: Int32) throws -> Float - - @JavaStaticMethod - public func getDouble(_ arg0: JavaObject?, _ arg1: Int32) throws -> Double - - @JavaStaticMethod - public func newInstance(_ arg0: JavaClass?, _ arg1: Int32) throws -> JavaObject! - - @JavaStaticMethod - public func newInstance(_ arg0: JavaClass?, _ arg1: [Int32]) throws -> JavaObject! - - @JavaStaticMethod - public func set(_ arg0: JavaObject?, _ arg1: Int32, _ arg2: JavaObject?) throws - - @JavaStaticMethod - public func setBoolean(_ arg0: JavaObject?, _ arg1: Int32, _ arg2: Bool) throws - - @JavaStaticMethod - public func setByte(_ arg0: JavaObject?, _ arg1: Int32, _ arg2: Int8) throws - - @JavaStaticMethod - public func setChar(_ arg0: JavaObject?, _ arg1: Int32, _ arg2: UInt16) throws - - @JavaStaticMethod - public func setShort(_ arg0: JavaObject?, _ arg1: Int32, _ arg2: Int16) throws - - @JavaStaticMethod - public func setInt(_ arg0: JavaObject?, _ arg1: Int32, _ arg2: Int32) throws - - @JavaStaticMethod - public func setLong(_ arg0: JavaObject?, _ arg1: Int32, _ arg2: Int64) throws - - @JavaStaticMethod - public func setFloat(_ arg0: JavaObject?, _ arg1: Int32, _ arg2: Float) throws - - @JavaStaticMethod - public func setDouble(_ arg0: JavaObject?, _ arg1: Int32, _ arg2: Double) throws -} diff --git a/Sources/SwiftJava/generated/JavaReflectParameterizedType.swift b/Sources/SwiftJava/generated/JavaReflectParameterizedType.swift deleted file mode 100644 index b9a18ddb..00000000 --- a/Sources/SwiftJava/generated/JavaReflectParameterizedType.swift +++ /dev/null @@ -1,17 +0,0 @@ -// Auto-generated by Java-to-Swift wrapper generator. -import SwiftJavaJNICore - -@JavaInterface("java.lang.reflect.ParameterizedType", extends: JavaReflectType.self) -public struct JavaReflectParameterizedType { - @JavaMethod - public func getOwnerType() -> JavaReflectType! - - @JavaMethod - public func getRawType() -> JavaReflectType! - - @JavaMethod - public func getActualTypeArguments() -> [JavaReflectType?] - - @JavaMethod - public func getTypeName() -> String -} diff --git a/Sources/SwiftJava/generated/JavaReflectType.swift b/Sources/SwiftJava/generated/JavaReflectType.swift deleted file mode 100644 index bc5d5d53..00000000 --- a/Sources/SwiftJava/generated/JavaReflectType.swift +++ /dev/null @@ -1,8 +0,0 @@ -// Auto-generated by Java-to-Swift wrapper generator. -import SwiftJavaJNICore - -@JavaInterface("java.lang.reflect.Type") -public struct JavaReflectType { - @JavaMethod - public func getTypeName() -> String -} diff --git a/Sources/SwiftJava/swift-java.config b/Sources/SwiftJava/swift-java.config index 42610164..925626ee 100644 --- a/Sources/SwiftJava/swift-java.config +++ b/Sources/SwiftJava/swift-java.config @@ -5,8 +5,6 @@ "java.lang.Byte" : "JavaByte", "java.lang.Character" : "JavaCharacter", "java.lang.Class" : "JavaClass", - "java.lang.reflect.Type" : "JavaReflectType", - "java.lang.reflect.ParameterizedType" : "JavaReflectParameterizedType", "java.lang.ClassLoader" : "JavaClassLoader", "java.lang.Double" : "JavaDouble", "java.lang.Error" : "JavaError", diff --git a/Sources/SwiftJavaToolLib/JavaClassTranslator.swift b/Sources/SwiftJavaToolLib/JavaClassTranslator.swift index b201823d..826522aa 100644 --- a/Sources/SwiftJavaToolLib/JavaClassTranslator.swift +++ b/Sources/SwiftJavaToolLib/JavaClassTranslator.swift @@ -141,13 +141,13 @@ struct JavaClassTranslator { // Superclass, incl parameter types (if any) if !javaClass.isInterface() { var javaSuperclass = javaClass.getSuperclass() - var javaGenericSuperclass: JavaReflectType? = javaClass.getGenericSuperclass() + var javaGenericSuperclass: Type? = javaClass.getGenericSuperclass() var swiftSuperclassName: String? = nil var swiftSuperclassTypeArgs: [String] = [] while let javaSuperclassNonOpt = javaSuperclass { do { swiftSuperclassName = try translator.getSwiftTypeName(javaSuperclassNonOpt, preferValueTypes: false).swiftName - if let javaGenericSuperclass = javaGenericSuperclass?.as(JavaReflectParameterizedType.self) { + if let javaGenericSuperclass = javaGenericSuperclass?.as(ParameterizedType.self) { for typeArg in javaGenericSuperclass.getActualTypeArguments() { let javaTypeArgName = typeArg?.getTypeName() ?? "" if let swiftTypeArgName = self.translator.translatedClasses[javaTypeArgName] {