Class Kernel

java.lang.Object
software.amazon.jsii.Kernel

@Internal public final class Kernel extends Object
A static helper to interact with the kernel in a "simple" way.
  • 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 call
      method - The name of the method.
      nativeType - The return type.
      args - Method arguments.
      Returns:
      A return value.
    • get

      @Nullable @Internal public static <T> T get(Object receiver, String property, NativeType<T> type)
      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.