Class GoogleDescriptorLoader

java.lang.Object
ai.pipestream.common.util.descriptor.GoogleDescriptorLoader
All Implemented Interfaces:
DescriptorLoader

public class GoogleDescriptorLoader extends Object implements DescriptorLoader
Loads Protocol Buffer descriptors from Google descriptor set files (.dsc). These files are typically generated by protoc with --descriptor_set_out flag and packaged in JAR files under META-INF/grpc/.

Example usage:

 GoogleDescriptorLoader loader = new GoogleDescriptorLoader("META-INF/grpc/services.dsc");
 List<FileDescriptor> descriptors = loader.loadDescriptors();
 
  • Field Details

    • DEFAULT_DESCRIPTOR_PATH

      public static final String DEFAULT_DESCRIPTOR_PATH
      Default descriptor path used by grpc-google-descriptor module.
      See Also:
  • Constructor Details

    • GoogleDescriptorLoader

      public GoogleDescriptorLoader()
      Creates a loader with the default descriptor path.
    • GoogleDescriptorLoader

      public GoogleDescriptorLoader(String descriptorPath)
      Creates a loader with a custom descriptor path.
      Parameters:
      descriptorPath - The classpath resource path to the .dsc file
    • GoogleDescriptorLoader

      public GoogleDescriptorLoader(String descriptorPath, ClassLoader classLoader)
      Creates a loader with a custom descriptor path and class loader.
      Parameters:
      descriptorPath - The classpath resource path to the .dsc file
      classLoader - The class loader to use for loading resources
  • Method Details