Package software.amazon.jsii
Class Kernel
java.lang.Object
software.amazon.jsii.Kernel
A static helper to interact with the kernel in a "simple" way.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> TasyncCall(Object receiver, String method, NativeType<T> nativeType, @Nullable Object... args) Calls an async method on the object.static <T> Tcall(Object receiver, String method, NativeType<T> nativeType, @Nullable Object... args) Calls a JavaScript method on a receiver.static <T> Tget(Object receiver, String property, NativeType<T> type) Gets a property value from the object.static voidSets a property value of an object.
-
Method Details
-
asyncCall
@Nullable @Internal public static <T> T asyncCall(Object receiver, String method, NativeType<T> nativeType, @Nullable @Nullable Object... args) Calls an async method on the object.- Type Parameters:
T- Java type for the return value.- Parameters:
receiver- the receiver for the method call.method- The name of the method.nativeType- The return type.args- Method arguments.- Returns:
- A return value.
-
call
@Nullable @Internal public static <T> T call(Object receiver, String method, NativeType<T> nativeType, @Nullable @Nullable Object... args) Calls a JavaScript method on a receiver.- Type Parameters:
T- Java type for the return value.- Parameters:
receiver- the receiver for the method callmethod- The name of the method.nativeType- The return type.args- Method arguments.- Returns:
- A return value.
-
get
Gets a property value from the object.- Type Parameters:
T- The Java type of the property.- Parameters:
receiver- The receiver of the property access.property- The property name.type- The Java type of the property.- Returns:
- The property value.
-
set
@Internal public static void set(Object receiver, String property, @Nullable @Nullable Object value) Sets a property value of an object.- Parameters:
receiver- The receiver of the property access.property- The name of the property.value- The property value.
-