Class EmbabelIntrospector

java.lang.Object
ai.badmonkey.agentspaces.embabel.EmbabelIntrospector

public final class EmbabelIntrospector extends Object
Reads Embabel agent metadata reflectively by fully qualified annotation name (spec ยง10.4), so this module compiles with no Embabel artifact and works with whichever Embabel version the application ships. The names are the published Embabel API annotations; attribute reads tolerate absent attributes across versions, and an application can only reach this code when the Embabel classes are present, because the autoconfiguration guards on the @Agent class by name.
  • Field Details

    • AGENT_ANNOTATION

      public static final String AGENT_ANNOTATION
      The Embabel agent annotation, by name.
      See Also:
    • ACTION_ANNOTATION

      public static final String ACTION_ANNOTATION
      The Embabel action annotation, by name.
      See Also:
    • GOAL_ANNOTATION

      public static final String GOAL_ANNOTATION
      The Embabel goal-achievement annotation, by name.
      See Also:
  • Method Details

    • embabelPresent

      public static boolean embabelPresent(ClassLoader classLoader)
      Tests whether the Embabel API is on the classpath.
      Parameters:
      classLoader - the application class loader
      Returns:
      true when Embabel's agent annotation loads
    • introspect

      public static Optional<EmbabelIntrospector.EmbabelAgent> introspect(Class<?> type)
      Introspects one bean.
      Parameters:
      type - the bean's class
      Returns:
      the Embabel metadata, or empty when the class carries no @Agent annotation
    • actionDescription

      public static String actionDescription(Method action)
      The description an Embabel @Action declares, empty when it has none.
      Parameters:
      action - an @Action method
      Returns:
      the description