Class DataContextDiagnostics

java.lang.Object
io.jmix.flowui.model.impl.DataContextDiagnostics

public class DataContextDiagnostics extends Object
Builds diagnostic log messages for attribute-level dirty tracking and merge decisions in DataContextImpl and DataContextChangeTracker. All output goes through the io.jmix.flowui.datacontext.diagnostics logger category at DEBUG level; call sites are expected to guard with log.isDebugEnabled() before building a message.

Messages never call toString() on an entity (which could trigger lazy loading or instance-name resolution over unfetched attributes); entities are rendered as ClassName-id via formatEntity(Object) instead.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected static final org.slf4j.Logger
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Not meant to be instantiated directly; protected only so the class can be subclassed to add or reuse message formats.
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    attributeDirtied(Object entity, String attribute, @Nullable Object baseline)
    Message for an attribute that just became dirty, showing the baseline its future changes are measured against.
    static String
    attributeReverted(Object entity, String attribute)
    Message for an attribute whose value returned to its baseline and is therefore no longer dirty.
    static String
    baselineRebased(Object entity, String attribute, @Nullable Object newBaseline)
    Message for a dirty attribute whose baseline was moved to an incoming (merged) value by a fresh merge.
    static String
    formatEntity(@Nullable Object value)
    Renders a value for a diagnostic message: ClassName-id for entities, "<collection>" for a membership bag (used as a collection baseline), "null" for null, and String.valueOf otherwise.
    static String
    mergeSkippedDirty(Object entity, String attribute)
    Message for a non-fresh merge that left a dirty attribute untouched, keeping the user's unsaved value.
    static String
    Message warning that merge() was called on a read-only NoopDataContext, so the change is neither tracked nor saved.

    Methods inherited from class java.lang.Object

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

    • log

      protected static final org.slf4j.Logger log
  • Constructor Details

    • DataContextDiagnostics

      protected DataContextDiagnostics()
      Not meant to be instantiated directly; protected only so the class can be subclassed to add or reuse message formats.
  • Method Details

    • attributeDirtied

      public static String attributeDirtied(Object entity, String attribute, @Nullable Object baseline)
      Message for an attribute that just became dirty, showing the baseline its future changes are measured against.
    • attributeReverted

      public static String attributeReverted(Object entity, String attribute)
      Message for an attribute whose value returned to its baseline and is therefore no longer dirty.
    • mergeSkippedDirty

      public static String mergeSkippedDirty(Object entity, String attribute)
      Message for a non-fresh merge that left a dirty attribute untouched, keeping the user's unsaved value.
    • baselineRebased

      public static String baselineRebased(Object entity, String attribute, @Nullable Object newBaseline)
      Message for a dirty attribute whose baseline was moved to an incoming (merged) value by a fresh merge.
    • readOnlyContextMerge

      public static String readOnlyContextMerge()
      Message warning that merge() was called on a read-only NoopDataContext, so the change is neither tracked nor saved.
    • formatEntity

      public static String formatEntity(@Nullable Object value)
      Renders a value for a diagnostic message: ClassName-id for entities, "<collection>" for a membership bag (used as a collection baseline), "null" for null, and String.valueOf otherwise. Never calls toString() on an entity.