Interface DescriptorLoader

All Known Implementing Classes:
ApicurioDescriptorLoader, GoogleDescriptorLoader

public interface DescriptorLoader
Generic interface for loading Protocol Buffer descriptors from various sources. This abstraction allows for multiple descriptor storage backends: - Google descriptor files (.dsc files on classpath) - Apicurio Schema Registry - Other schema registries
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static class 
    Exception thrown when descriptor loading fails.
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets a human-readable name for this loader type.
    boolean
    Checks if this loader is available and can load descriptors.
    com.google.protobuf.Descriptors.FileDescriptor
    Loads a specific file descriptor by name.
    List<com.google.protobuf.Descriptors.FileDescriptor>
    Loads all available file descriptors from this loader's source.
  • Method Details

    • loadDescriptors

      List<com.google.protobuf.Descriptors.FileDescriptor> loadDescriptors() throws DescriptorLoader.DescriptorLoadException
      Loads all available file descriptors from this loader's source.
      Returns:
      A list of FileDescriptors
      Throws:
      DescriptorLoader.DescriptorLoadException - if loading fails
    • loadDescriptor

      com.google.protobuf.Descriptors.FileDescriptor loadDescriptor(String fileName) throws DescriptorLoader.DescriptorLoadException
      Loads a specific file descriptor by name.
      Parameters:
      fileName - The proto file name (e.g., "my_types.proto")
      Returns:
      The FileDescriptor, or null if not found
      Throws:
      DescriptorLoader.DescriptorLoadException - if loading fails
    • isAvailable

      boolean isAvailable()
      Checks if this loader is available and can load descriptors. For example, a GoogleDescriptorLoader would return false if the .dsc file is not on classpath.
      Returns:
      true if the loader can load descriptors
    • getLoaderType

      String getLoaderType()
      Gets a human-readable name for this loader type.
      Returns:
      The loader type name