类 AbstractMcpServerComponent<T>
java.lang.Object
com.github.codeboyzhou.mcp.declarative.server.component.AbstractMcpServerComponent<T>
- 类型参数:
T- the type of the component
- 所有已实现的接口:
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
-
字段概要
字段修饰符和类型字段说明protected final DependencyInjectorThe dependency injector to use for injecting component attributes. -
构造器概要
构造器限定符构造器说明protectedCreates a new instance ofAbstractMcpServerComponent. -
方法概要
修饰符和类型方法说明protected StringlocalizeAttribute(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.从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait从接口继承的方法 com.github.codeboyzhou.mcp.declarative.server.component.McpServerComponent
create
-
字段详细资料
-
injector
The dependency injector to use for injecting component attributes.
-
-
构造器详细资料
-
AbstractMcpServerComponent
protected AbstractMcpServerComponent()Creates a new instance ofAbstractMcpServerComponent.
-
-
方法详细资料
-
localizeAttribute
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 localizedefaultValue- 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
-