Class ModelGenerator

java.lang.Object
com.hedera.pbj.compiler.impl.generators.ModelGenerator
All Implemented Interfaces:
Generator

public final class ModelGenerator extends Object implements Generator
Code generator that parses protobuf files and generates nice Java source for record files for each message type and enum.
  • Constructor Details

    • ModelGenerator

      public ModelGenerator()
  • Method Details

    • generate

      public void generate(Protobuf3Parser.MessageDefContext msgDef, File destinationSrcDir, File destinationTestSrcDir, ContextualLookupHelper lookupHelper) throws IOException
      Generate a code from protobuf message type

      Generates a new model object, as a Java Record type.

      Specified by:
      generate in interface Generator
      Parameters:
      msgDef - the parsed message
      destinationSrcDir - the destination source directory to generate into
      destinationTestSrcDir - the destination source directory to generate test files into
      lookupHelper - Lookup helper for global context lookups
      Throws:
      IOException - if there was a problem writing generated code