类 AbstractMcpServerComponent<T>

java.lang.Object
com.github.codeboyzhou.mcp.declarative.server.component.AbstractMcpServerComponent<T>
类型参数:
T - the type of the component
所有已实现的接口:
McpServerComponent<T>
直接已知子类:
McpServerCompletion, McpServerPrompt, McpServerResource, McpServerTool

public abstract class AbstractMcpServerComponent<T> extends Object implements McpServerComponent<T>
This abstract class represents an MCP server component (resource/prompt/tool) that is responsible for creating instances of a specific type T for a given method, and provides common functionality for all MCP server components.
作者:
codeboyzhou
  • 字段详细资料

    • injector

      protected final DependencyInjector injector
      The dependency injector to use for injecting component attributes.
  • 构造器详细资料

    • AbstractMcpServerComponent

      protected AbstractMcpServerComponent()
      Creates a new instance of AbstractMcpServerComponent.
  • 方法详细资料

    • localizeAttribute

      protected String localizeAttribute(String i18nKey, String defaultValue)
      Localizes the attribute with the specified i18n key using the resource bundle, or returns the default value if the key is not found in the bundle.
      参数:
      i18nKey - the i18n key of the attribute to localize
      defaultValue - the default value to return if the i18n key is not found in the bundle
      返回:
      the localized value of the attribute, or the default value if the i18n key is not found in the bundle