Class IntrospectUtil

java.lang.Object
react4j.internal.IntrospectUtil

@OmitType(unless="react4j.store_debug_data_as_state") 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<Object> data)
    For the specified observer, collect all dependencies and record them in data to be emitted as debug data.
    static Object
    getValue(arez.spy.ObservableValueInfo observableInfo)
    Return the value for specified observable.
    static boolean
    prepareStateUpdate(jsinterop.base.JsPropertyMap<Object> newState, jsinterop.base.JsPropertyMap<Object> currentState)
    Prepare the newState value to be updated given specified current state.

    Methods inherited from class java.lang.Object

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

    • getValue

      @Nullable public static Object getValue(@Nonnull 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(@Nonnull arez.Observer observer, @Nonnull jsinterop.base.JsPropertyMap<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(@Nonnull jsinterop.base.JsPropertyMap<Object> newState, @Nullable jsinterop.base.JsPropertyMap<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.