Class ServerValuesRegistry

java.lang.Object
org.apache.juneau.console.widgets.ServerValuesRegistry

public class ServerValuesRegistry extends Object
An internal, per-render resolver for a single ServerValues declaration.

A registry is added to a sibling VarResolverSession bean store so provider values never leak across requests. ServerValuesVar ($FV) looks this bean up in the session and delegates each "$FV{name}" resolution to resolve(VarResolverSession, String).

Resolution rejects non-scalar provider results (no List.toString() join) and memoizes only entries flagged ServerValuesValue.cacheable. A missing name returns null so the caller's DefaultingVar default applies; a provider that throws is allowed to propagate (fail-closed).

Since:
10.0.0
  • Method Details

    • of

      public static ServerValuesRegistry of(ServerValues serverValues)
      Creates a per-render registry over the specified declaration.
      Parameters:
      serverValues - The declaration. Must not be null.
      Returns:
      A new ServerValuesRegistry.
    • resolve

      public String resolve(VarResolverSession session, String name)
      Resolves a single named scalar value.
      Parameters:
      session - The per-render session passed to the provider.
      name - The interpolation name (first DefaultingVar field only).
      Returns:
      The resolved scalar as a string, or null if the name is not declared or the provider returned null (so a DefaultingVar default applies).