Class JsiiObject

java.lang.Object
software.amazon.jsii.JsiiObject
All Implemented Interfaces:
JsiiSerializable

public class JsiiObject extends Object implements JsiiSerializable
Represents a JavaScript object in the Java world.
  • Constructor Details

    • JsiiObject

      protected JsiiObject(JsiiObject.InitializationMode initializationMode)
      A special constructor that allows creating wrapper objects while bypassing the normal constructor chain. This is used when an object was created in javascript-land and just needs a wrapper in native-land.
      Parameters:
      initializationMode - Must always be set to "JSII".
    • JsiiObject

      @Internal protected JsiiObject(JsiiObjectRef objRef)
      Used to construct a JSII object with a reference to an existing managed JSII node object.
      Parameters:
      objRef - Reference to existing managed JSII node object.
  • Method Details

    • jsiiCall

      @Nullable @Deprecated @Internal protected final <T> T jsiiCall(String method, Class<T> returnType, @Nullable @Nullable Object... args)
      Calls a JavaScript method on the object.
      Type Parameters:
      T - Java type for the return value.
      Parameters:
      method - The name of the method.
      returnType - The return type.
      args - Method arguments.
      Returns:
      A return value.
    • jsiiCall

      @Nullable @Deprecated @Internal protected final <T> T jsiiCall(String method, NativeType<T> nativeType, @Nullable @Nullable Object... args)
      Calls a JavaScript method on the object.
      Type Parameters:
      T - Java type for the return value.
      Parameters:
      method - The name of the method.
      nativeType - The return type.
      args - Method arguments.
      Returns:
      A return value.
    • jsiiStaticCall

      @Nullable @Deprecated @Internal protected static <T> T jsiiStaticCall(Class<?> nativeClass, String method, Class<T> returnType, @Nullable @Nullable Object... args)
      Calls a static method.
      Type Parameters:
      T - Return type.
      Parameters:
      nativeClass - The java class.
      method - The method to call.
      returnType - The return type.
      args - The method arguments.
      Returns:
      Return value.
    • jsiiStaticCall

      @Nullable @Internal protected static <T> T jsiiStaticCall(Class<?> nativeClass, String method, NativeType<T> nativeType, @Nullable @Nullable Object... args)
      Calls a static method.
      Type Parameters:
      T - Return type.
      Parameters:
      nativeClass - The java class.
      method - The method to call.
      nativeType - The return type.
      args - The method arguments.
      Returns:
      Return value.
    • jsiiAsyncCall

      @Nullable @Deprecated @Internal protected final <T> T jsiiAsyncCall(String method, Class<T> returnType, @Nullable @Nullable Object... args)
      Calls an async method on the object.
      Type Parameters:
      T - Java type for the return value.
      Parameters:
      method - The name of the method.
      returnType - The return type.
      args - Method arguments.
      Returns:
      A return value.
    • jsiiAsyncCall

      @Nullable @Internal protected final <T> T jsiiAsyncCall(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:
      method - The name of the method.
      nativeType - The return type.
      args - Method arguments.
      Returns:
      A return value.
    • jsiiGet

      @Nullable @Deprecated @Internal protected final <T> T jsiiGet(String property, Class<T> type)
      Gets a property value from the object.
      Type Parameters:
      T - The Java type of the property.
      Parameters:
      property - The property name.
      type - The Java type of the property.
      Returns:
      The property value.
    • jsiiGet

      @Nullable @Deprecated @Internal protected final <T> T jsiiGet(String property, NativeType<T> type)
      Gets a property value from the object.
      Type Parameters:
      T - The Java type of the property.
      Parameters:
      property - The property name.
      type - The Java type of the property.
      Returns:
      The property value.
    • jsiiStaticGet

      @Nullable @Deprecated @Internal protected static <T> T jsiiStaticGet(Class<?> nativeClass, String property, Class<T> type)
      Returns the value of a static property.
      Type Parameters:
      T - Return type
      Parameters:
      nativeClass - The java class.
      property - The name of the property.
      type - The expected java return type.
      Returns:
      Return value
    • jsiiStaticGet

      @Nullable @Internal protected static <T> T jsiiStaticGet(Class<?> nativeClass, String property, NativeType<T> type)
      Returns the value of a static property.
      Type Parameters:
      T - Return type
      Parameters:
      nativeClass - The java class.
      property - The name of the property.
      type - The expected java return type.
      Returns:
      Return value
    • jsiiSet

      @Deprecated @Internal protected final void jsiiSet(String property, @Nullable @Nullable Object value)
      Deprecated.
      Sets a property value of an object.
      Parameters:
      property - The name of the property.
      value - The property value.
    • jsiiStaticSet

      @Internal protected static void jsiiStaticSet(Class<?> nativeClass, String property, @Nullable @Nullable Object value)
      Sets a value for a static property.
      Parameters:
      nativeClass - The java class.
      property - The name of the property
      value - The value
    • jsiiStaticSet

      @Internal protected static void jsiiStaticSet(JsiiEngine engine, Class<?> nativeClass, String property, @Nullable @Nullable Object value)
      Sets a value for a static property. This method is meant to be used only in unit tests.
      Parameters:
      engine - The JsiiEngine to use.
      nativeClass - The java class.
      property - The name of the property
      value - The value