Interface AgentDeclarationReader

All Known Implementing Classes:
EmbabelDeclarationReader

public interface AgentDeclarationReader
Reads an agent's declaration from a framework's own annotations, so the core binder makes the one card for a bean that is both a fleet worker and, say, an Embabel @Agent (reviews/embabel-agentspaces-review-2026-11-12.md §7.2). The binder consults readers after @AgentSpec and before the class-name rule: a reader supplies the card's name, description and goals, the bindings it implies for methods that carry no space annotation (§7.3, the "map of 1"), and the actions it advertises without binding.

Readers are found with ServiceLoader on the binder's class loader and the thread's context loader, and a host may register configured instances directly through AgentSpaces.declarationReaders(List) (or AgentBinder.registerDeclarationReader). A registered reader replaces a loaded one of the same class. Readers are tried in order, lowest first; the first that answers wins.

  • Method Summary

    Modifier and Type
    Method
    Description
    default int
    The reader's precedence among readers; lower first.
    read(Class<?> userClass)
    Reads one class.
  • Method Details

    • read

      Optional<AgentDeclaration> read(Class<?> userClass)
      Reads one class.
      Parameters:
      userClass - the bean's user class (a proxy already unwrapped to the class it proxies)
      Returns:
      the declaration, or empty when this reader does not recognise the class
    • order

      default int order()
      The reader's precedence among readers; lower first.
      Returns:
      the order, default 0