Class ServiceGenerator

java.lang.Object
com.hedera.pbj.compiler.impl.generators.ServiceGenerator

public final class ServiceGenerator extends Object
Service code generator.
  • Field Details

    • SUFFIX

      public static final String SUFFIX
      Suffix for the generated interface name that follows the service name. Ideally we'd add the "Service" suffix. However, our protobufs add this suffix to their service names already. This would result in e.g. "TokenServiceService.java" which looks odd. So we add "Interface" which makes perfect sense because we generate a Java interface here.
      See Also:
  • Constructor Details

    • ServiceGenerator

      public ServiceGenerator()
  • Method Details

    • generateService

      public static void generateService(Protobuf3Parser.ServiceDefContext serviceDef, JavaFileWriter writer, ContextualLookupHelper lookupHelper) throws IOException
      Generate a Java service interface from protobuf service
      Parameters:
      serviceDef - the parsed service def
      writer - the writer to append the generated service to
      lookupHelper - Lookup helper for package information
      Throws:
      IOException - if there was a problem writing generated code