Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,8 @@ extension JavaClass {

@JavaMethod
public func getAnnotations() -> [Annotation?]

public func `as`(_: Type.Type) -> Type {
Type(javaHolder: javaHolder)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ open class AccessibleObject: JavaObject {
/// ```java
/// public <T extends java.lang.annotation.Annotation> T java.lang.reflect.AccessibleObject.getAnnotation(java.lang.Class<T>)
/// ```
@JavaMethod(typeErasedResult: "T!")
@JavaMethod(typeErasedResult: "T!", typeErasedResultBound: Annotation?.self)
open func getAnnotation<T: AnyJavaObject>(_ arg0: JavaClass<T>?) -> T!

/// Java method `getAnnotationsByType`.
Expand All @@ -55,7 +55,7 @@ open class AccessibleObject: JavaObject {
/// ```java
/// public <T extends java.lang.annotation.Annotation> T java.lang.reflect.AccessibleObject.getDeclaredAnnotation(java.lang.Class<T>)
/// ```
@JavaMethod(typeErasedResult: "T!")
@JavaMethod(typeErasedResult: "T!", typeErasedResultBound: Annotation?.self)
open func getDeclaredAnnotation<T: AnyJavaObject>(_ arg0: JavaClass<T>?) -> T!

/// Java method `getDeclaredAnnotationsByType`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,84 @@ import SwiftJavaJNICore

@JavaInterface("java.lang.reflect.AnnotatedType")
public struct AnnotatedType {
/// Java method `getAnnotatedOwnerType`.
///
/// ### Java method signature
/// ```java
/// public default java.lang.reflect.AnnotatedType java.lang.reflect.AnnotatedType.getAnnotatedOwnerType()
/// ```
@JavaMethod
public func getAnnotatedOwnerType() -> AnnotatedType!

@JavaMethod
public func getAnnotation(_ arg0: JavaClass<Annotation>?) -> Annotation!
/// Java method `getAnnotation`.
///
/// ### Java method signature
/// ```java
/// public abstract <T extends java.lang.annotation.Annotation> T java.lang.reflect.AnnotatedType.getAnnotation(java.lang.Class<T>)
/// ```
@JavaMethod(typeErasedResult: "T!", typeErasedResultBound: Annotation?.self)
public func getAnnotation<T: AnyJavaObject>(_ arg0: JavaClass<T>?) -> T!

/// Java method `getAnnotations`.
///
/// ### Java method signature
/// ```java
/// public abstract java.lang.annotation.Annotation[] java.lang.reflect.AnnotatedType.getAnnotations()
/// ```
@JavaMethod
public func getAnnotations() -> [Annotation?]

/// Java method `getDeclaredAnnotations`.
///
/// ### Java method signature
/// ```java
/// public abstract java.lang.annotation.Annotation[] java.lang.reflect.AnnotatedType.getDeclaredAnnotations()
/// ```
@JavaMethod
public func getDeclaredAnnotations() -> [Annotation?]

/// Java method `getType`.
///
/// ### Java method signature
/// ```java
/// public abstract java.lang.reflect.Type java.lang.reflect.AnnotatedType.getType()
/// ```
@JavaMethod
public func getType() -> Type!

/// Java method `isAnnotationPresent`.
///
/// ### Java method signature
/// ```java
/// public default boolean java.lang.reflect.AnnotatedElement.isAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation>)
/// ```
@JavaMethod
public func isAnnotationPresent(_ arg0: JavaClass<Annotation>?) -> Bool

/// Java method `getAnnotationsByType`.
///
/// ### Java method signature
/// ```java
/// public default <T extends java.lang.annotation.Annotation> T[] java.lang.reflect.AnnotatedElement.getAnnotationsByType(java.lang.Class<T>)
/// ```
@JavaMethod
public func getAnnotationsByType(_ arg0: JavaClass<Annotation>?) -> [Annotation?]
public func getAnnotationsByType<T: AnyJavaObject>(_ arg0: JavaClass<T>?) -> [T?]

@JavaMethod
public func getDeclaredAnnotation(_ arg0: JavaClass<Annotation>?) -> Annotation!
/// Java method `getDeclaredAnnotation`.
///
/// ### Java method signature
/// ```java
/// public default <T extends java.lang.annotation.Annotation> T java.lang.reflect.AnnotatedElement.getDeclaredAnnotation(java.lang.Class<T>)
/// ```
@JavaMethod(typeErasedResult: "T!", typeErasedResultBound: Annotation?.self)
public func getDeclaredAnnotation<T: AnyJavaObject>(_ arg0: JavaClass<T>?) -> T!

/// Java method `getDeclaredAnnotationsByType`.
///
/// ### Java method signature
/// ```java
/// public default <T extends java.lang.annotation.Annotation> T[] java.lang.reflect.AnnotatedElement.getDeclaredAnnotationsByType(java.lang.Class<T>)
/// ```
@JavaMethod
public func getDeclaredAnnotationsByType(_ arg0: JavaClass<Annotation>?) -> [Annotation?]
public func getDeclaredAnnotationsByType<T: AnyJavaObject>(_ arg0: JavaClass<T>?) -> [T?]
}
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ open class Constructor<T: AnyJavaObject>: Executable {
/// ```java
/// public <T extends java.lang.annotation.Annotation> T java.lang.reflect.Constructor.getAnnotation(java.lang.Class<T>)
/// ```
@JavaMethod(typeErasedResult: "T!")
@JavaMethod(typeErasedResult: "T!", typeErasedResultBound: Annotation?.self)
open override func getAnnotation<T: AnyJavaObject>(_ arg0: JavaClass<T>?) -> T!

/// Java method `getDeclaredAnnotations`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ open class Executable: AccessibleObject {
/// ```java
/// public <T extends java.lang.annotation.Annotation> T java.lang.reflect.Executable.getAnnotation(java.lang.Class<T>)
/// ```
@JavaMethod(typeErasedResult: "T!")
@JavaMethod(typeErasedResult: "T!", typeErasedResultBound: Annotation?.self)
open override func getAnnotation<T: AnyJavaObject>(_ arg0: JavaClass<T>?) -> T!

/// Java method `getAnnotationsByType`.
Expand Down
2 changes: 1 addition & 1 deletion Sources/JavaStdlib/JavaLangReflect/generated/Field.swift
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ open class Field: AccessibleObject {
/// ```java
/// public <T extends java.lang.annotation.Annotation> T java.lang.reflect.Field.getAnnotation(java.lang.Class<T>)
/// ```
@JavaMethod(typeErasedResult: "T!")
@JavaMethod(typeErasedResult: "T!", typeErasedResultBound: Annotation?.self)
open override func getAnnotation<T: AnyJavaObject>(_ arg0: JavaClass<T>?) -> T!

/// Java method `getAnnotationsByType`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,75 @@ import SwiftJavaJNICore

@JavaInterface("java.lang.reflect.GenericDeclaration")
public struct GenericDeclaration {
/// Java method `getTypeParameters`.
///
/// ### Java method signature
/// ```java
/// public abstract java.lang.reflect.TypeVariable<?>[] java.lang.reflect.GenericDeclaration.getTypeParameters()
/// ```
@JavaMethod
public func getTypeParameters() -> [TypeVariable<JavaObject>?]

/// Java method `isAnnotationPresent`.
///
/// ### Java method signature
/// ```java
/// public default boolean java.lang.reflect.AnnotatedElement.isAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation>)
/// ```
@JavaMethod
public func isAnnotationPresent(_ arg0: JavaClass<Annotation>?) -> Bool

@JavaMethod
public func getAnnotation(_ arg0: JavaClass<Annotation>?) -> Annotation!
/// Java method `getAnnotation`.
///
/// ### Java method signature
/// ```java
/// public abstract <T extends java.lang.annotation.Annotation> T java.lang.reflect.AnnotatedElement.getAnnotation(java.lang.Class<T>)
/// ```
@JavaMethod(typeErasedResult: "T!", typeErasedResultBound: Annotation?.self)
public func getAnnotation<T: AnyJavaObject>(_ arg0: JavaClass<T>?) -> T!

/// Java method `getAnnotationsByType`.
///
/// ### Java method signature
/// ```java
/// public default <T extends java.lang.annotation.Annotation> T[] java.lang.reflect.AnnotatedElement.getAnnotationsByType(java.lang.Class<T>)
/// ```
@JavaMethod
public func getAnnotationsByType(_ arg0: JavaClass<Annotation>?) -> [Annotation?]
public func getAnnotationsByType<T: AnyJavaObject>(_ arg0: JavaClass<T>?) -> [T?]

/// Java method `getAnnotations`.
///
/// ### Java method signature
/// ```java
/// public abstract java.lang.annotation.Annotation[] java.lang.reflect.AnnotatedElement.getAnnotations()
/// ```
@JavaMethod
public func getAnnotations() -> [Annotation?]

@JavaMethod
public func getDeclaredAnnotation(_ arg0: JavaClass<Annotation>?) -> Annotation!
/// Java method `getDeclaredAnnotation`.
///
/// ### Java method signature
/// ```java
/// public default <T extends java.lang.annotation.Annotation> T java.lang.reflect.AnnotatedElement.getDeclaredAnnotation(java.lang.Class<T>)
/// ```
@JavaMethod(typeErasedResult: "T!", typeErasedResultBound: Annotation?.self)
public func getDeclaredAnnotation<T: AnyJavaObject>(_ arg0: JavaClass<T>?) -> T!

/// Java method `getDeclaredAnnotationsByType`.
///
/// ### Java method signature
/// ```java
/// public default <T extends java.lang.annotation.Annotation> T[] java.lang.reflect.AnnotatedElement.getDeclaredAnnotationsByType(java.lang.Class<T>)
/// ```
@JavaMethod
public func getDeclaredAnnotationsByType(_ arg0: JavaClass<Annotation>?) -> [Annotation?]
public func getDeclaredAnnotationsByType<T: AnyJavaObject>(_ arg0: JavaClass<T>?) -> [T?]

/// Java method `getDeclaredAnnotations`.
///
/// ### Java method signature
/// ```java
/// public abstract java.lang.annotation.Annotation[] java.lang.reflect.AnnotatedElement.getDeclaredAnnotations()
/// ```
@JavaMethod
public func getDeclaredAnnotations() -> [Annotation?]
}
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ open class Method: Executable {
/// ```java
/// public <T extends java.lang.annotation.Annotation> T java.lang.reflect.Method.getAnnotation(java.lang.Class<T>)
/// ```
@JavaMethod(typeErasedResult: "T!")
@JavaMethod(typeErasedResult: "T!", typeErasedResultBound: Annotation?.self)
open override func getAnnotation<T: AnyJavaObject>(_ arg0: JavaClass<T>?) -> T!

/// Java method `getDeclaredAnnotations`.
Expand Down
Loading
Loading