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 Details

    • getValue

      @Nullable public static Object getValue(@Nonnull 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 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.