Class ExampleMetadataProvider


  • public final class ExampleMetadataProvider
    extends Object
    Class for loading and caching code example metadata from JSON files.
    • Constructor Detail

      • ExampleMetadataProvider

        public ExampleMetadataProvider​(String exampleMetaPath)
        Creates an ExampleMetadataProvider instance for the given JSON file path.
        Parameters:
        exampleMetaPath - path to the example metadata JSON file
    • Method Detail

      • createLinkToCodeExample

        public Optional<String> createLinkToCodeExample​(Metadata metadata,
                                                        String operationName)
        Creates a link to a code example for the given operation.
        Parameters:
        metadata - the service metadata
        operationName - the name of the operation to find an example for
        Returns:
        Optional containing the HTML link to the code example, or empty if no example found
      • getServiceCodeExamples

        public List<ExampleMetadataProvider.ExampleData> getServiceCodeExamples​(Metadata metadata)
        Gets all code examples for a specific service.
        Parameters:
        metadata - the service metadata
        Returns:
        a list of examples for the service