Class ProtocPlugin

java.lang.Object
com.salesforce.jprotoc.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 Summary

    Modifier and Type
    Method
    Description
    static void
    debug(Generator generator, String dumpPath)
    Debug a single generator using the parsed proto descriptor.
    static void
    debug(List<Generator> generators, String dumpPath)
    Debug multiple generators using the parsed proto descriptor, aggregating their results.
    static void
    debug(List<Generator> generators, List<com.google.protobuf.GeneratedMessage.GeneratedExtension> extensions, String dumpPath)
    Debug multiple generators using the parsed proto descriptor, aggregating their results.
    static void
    generate(Generator generator)
    Apply a single generator to the parsed proto descriptor.
    static void
    generate(List<Generator> generators)
    Apply multiple generators to the parsed proto descriptor, aggregating their results.
    static void
    generate(List<Generator> generators, List<com.google.protobuf.GeneratedMessage.GeneratedExtension> extensions)
    Apply multiple generators to the parsed proto descriptor, aggregating their results.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • 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.