Package su.onno.ui

Class UiViewResolver

java.lang.Object
su.onno.ui.UiViewResolver

public class UiViewResolver extends Object
Resolves a per-entity EntityView (authored in code) over the auto-generated metadata defaults into a renderer-agnostic ResolvedListView. Internal resolution can produce defaults, but routed DivKit surfaces treat the registered views as an allowlist and call hasView(Class, String) before rendering. The model remains renderer-neutral.
  • Constructor Details

  • Method Details

    • catalogList

      public ResolvedListView catalogList(CatalogDescriptor d, String profileId)
    • documentList

      public ResolvedListView documentList(DocumentDescriptor d, String profileId)
    • hasView

      public boolean hasView(Class<?> entity, String profileId)
      Whether this entity is declared by a view (profile-specific or default) and may therefore appear in the UI. The view layer is the allowlist: an entity with no view is hidden from nav and its surfaces 404 — only what's authored renders.
    • commentsEnabled

      public boolean commentsEnabled(Class<?> entity)
      Whether comments are enabled for this entity — true if any of its views (default or profile-specific) opts in via EntityView.comments(). The comment panel and the /api/comments endpoint are both gated on this, so comments are an opt-in, per-entity capability (on top of the global onno.comments.enabled switch). Resolved at the entity level, not per profile.
    • rowStyle

      public Function<ActionRow,ListSpec.RowStyle> rowStyle(Class<?> entity)
      The entity's conditional row-formatting function (ListSpec.rowStyle(java.util.function.Function<su.onno.ui.ActionRow, su.onno.ui.ListSpec.RowStyle>)), or null when no view declares one. Resolved at the entity level — the default-profile view first, then any profile-specific one — because the list-data feed that evaluates it has no profile context (mirroring how UiActionResolver aggregates actions across views).