Class ProtocPlugin


  • public final class ProtocPlugin
    extends Object
    ProtocPlugin is the main entry point for running one or more java-base protoc plugins. This class handles I/O marshaling and error reporting.
    • Method Detail

      • generate

        public static void generate​(@Nonnull
                                    Generator generator)
        Apply a single generator to the parsed proto descriptor.
        Parameters:
        generator - The generator to run.
      • generate

        public static void generate​(@Nonnull
                                    List<Generator> generators)
        Apply multiple generators to the parsed proto descriptor, aggregating their results.
        Parameters:
        generators - The list of generators to run.
      • generate

        public static void generate​(@Nonnull
                                    List<Generator> generators,
                                    List<com.google.protobuf.GeneratedMessage.GeneratedExtension> extensions)
        Apply multiple generators to the parsed proto descriptor, aggregating their results. Also register the given extensions so they may be processed by the generator.
        Parameters:
        generators - The list of generators to run.
        extensions - The list of extensions to register.
      • debug

        public static void debug​(@Nonnull
                                 Generator generator,
                                 @Nonnull
                                 String dumpPath)
        Debug a single generator using the parsed proto descriptor.
        Parameters:
        generator - The generator to run.
        dumpPath - The path to a descriptor dump on the filesystem.
      • debug

        public static void debug​(@Nonnull
                                 List<Generator> generators,
                                 @Nonnull
                                 String dumpPath)
        Debug multiple generators using the parsed proto descriptor, aggregating their results.
        Parameters:
        generators - The list of generators to run.
        dumpPath - The path to a descriptor dump on the filesystem.
      • debug

        public static void debug​(@Nonnull
                                 List<Generator> generators,
                                 List<com.google.protobuf.GeneratedMessage.GeneratedExtension> extensions,
                                 @Nonnull
                                 String dumpPath)
        Debug multiple generators using the parsed proto descriptor, aggregating their results. Also register the given extensions so they may be processed by the generator.
        Parameters:
        generators - The list of generators to run.
        extensions - The list of extensions to register.
        dumpPath - The path to a descriptor dump on the filesystem.