Class IntrospectUtil

java.lang.Object
react4j.internal.IntrospectUtil

public final class IntrospectUtil extends Object
Utilities for introspecting the React4j views and runtime.
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    collectDependencyDebugData(arez.Observer observer, jsinterop.base.JsPropertyMap<@Nullable Object> data)
    For the specified observer, collect all dependencies and record them in data to be emitted as debug data.
    static @Nullable Object
    getValue(arez.spy.ObservableValueInfo observableInfo)
    Return the value for specified observable.
    static boolean
    prepareStateUpdate(jsinterop.base.JsPropertyMap<@Nullable Object> newState, @Nullable jsinterop.base.JsPropertyMap<@Nullable Object> currentState)
    Prepare the newState value to be updated given specified current state.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • getValue

      public static @Nullable Object getValue(arez.spy.ObservableValueInfo observableInfo)
      Return the value for specified observable. Exceptions are caught and types are converted to strings using Object.toString()
      Parameters:
      observableInfo - the observable.
      Returns:
      the value as a string.
    • collectDependencyDebugData

      public static void collectDependencyDebugData(arez.Observer observer, jsinterop.base.JsPropertyMap<@Nullable Object> data)
      For the specified observer, collect all dependencies and record them in data to be emitted as debug data.
      Parameters:
      observer - the observer.
      data - the target in which to place debug data.
    • prepareStateUpdate

      public static boolean prepareStateUpdate(jsinterop.base.JsPropertyMap<@Nullable Object> newState, @Nullable jsinterop.base.JsPropertyMap<@Nullable Object> currentState)
      Prepare the newState value to be updated given specified current state. If no changes are required then return false.
      Parameters:
      newState - the new "state" of the view.
      currentState - the current "state" of the view.
      Returns:
      true if newState needs to be saved to native view, false otherwise.