Package ai.wanaku.cli.main.support
Class DocumentationLoader
java.lang.Object
ai.wanaku.cli.main.support.DocumentationLoader
Utility class for loading documentation resources in both JVM and native mode.
This class provides methods to load Markdown documentation files from the classpath in a way that works correctly in both regular JVM mode and GraalVM native image mode.
Resources are loaded using the thread context class loader, which ensures compatibility with Quarkus native compilation.
Example usage:
// Load label expressions documentation
String markdown = DocumentationLoader.loadLabelExpressionsDoc();
printer.printMarkdown(markdown);
// Load custom documentation
String custom = DocumentationLoader.loadDoc("docs/MY_DOC.md");
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classException thrown when a documentation file cannot be found. -
Method Summary
-
Method Details
-
loadLabelExpressionsDoc
Loads the label expressions documentation.This is a convenience method that loads the standard label expressions documentation file.
- Returns:
- the label expressions documentation as a String
- Throws:
DocumentationLoader.DocumentationNotFoundException- if the documentation file cannot be foundIOException- if an error occurs reading the documentation
-
loadDoc
Loads a documentation file from the classpath.The path should be relative to the resources directory. For example, to load
src/main/resources/docs/MY_DOC.md, use"docs/MY_DOC.md".This method works correctly in both JVM and GraalVM native image mode, provided the resource is included in the native image configuration.
- Parameters:
resourcePath- the path to the documentation file (relative to resources directory)- Returns:
- the documentation content as a String
- Throws:
DocumentationLoader.DocumentationNotFoundException- if the documentation file cannot be foundIOException- if an error occurs reading the documentation
-