Class MetaUtils
java.lang.Object
org.springframework.ai.mcp.annotation.common.MetaUtils
Utility methods for working with
MetaProvider metadata.
This class provides a single entry point getMeta(Class) that instantiates the
given provider type via a no-argument constructor and returns its metadata as an
unmodifiable Map.
Instantiation failures and missing no-arg constructors are reported as
IllegalArgumentExceptions. This class is stateless and
not intended to be instantiated.
- Author:
- Vadzim Shurmialiou, Craig Walls
-
Method Summary
Modifier and TypeMethodDescriptiongetMeta(Class<? extends MetaProvider> metaProviderClass) Instantiate the suppliedMetaProvidertype using a no-argument constructor and return the metadata it supplies.
-
Method Details
-
getMeta
Instantiate the suppliedMetaProvidertype using a no-argument constructor and return the metadata it supplies.The returned map is wrapped in
Collections.unmodifiableMap(Map)to prevent external modification. If the provider returnsnull, this method also returnsnull.- Parameters:
metaProviderClass- theMetaProviderimplementation class to instantiate; must provide a no-arg constructor- Returns:
- an unmodifiable metadata map, or
nullif the provider returnsnull - Throws:
IllegalArgumentException- if a no-arg constructor is missing or the instance cannot be created
-