Class ServiceGenerator
java.lang.Object
com.hedera.pbj.compiler.impl.generators.ServiceGenerator
Service code generator.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidgenerateService(Protobuf3Parser.ServiceDefContext serviceDef, JavaFileWriter writer, ContextualLookupHelper lookupHelper) Generate a Java service interface from protobuf service
-
Field Details
-
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 defwriter- the writer to append the generated service tolookupHelper- Lookup helper for package information- Throws:
IOException- if there was a problem writing generated code
-