Class AvroPlugin

java.lang.Object
be.appify.prefab.avro.processor.AvroPlugin
All Implemented Interfaces:
be.appify.prefab.processor.PrefabPlugin

public class AvroPlugin extends Object implements be.appify.prefab.processor.PrefabPlugin
A plugin for generating Avro converters and schema factories for events annotated with Event with Avro serialization.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static List<be.appify.prefab.processor.TypeManifest>
    avroUnionRecordBranches(be.appify.prefab.processor.TypeManifest unionType)
    Returns the nested-record component types from the permitted subtypes of an Avro union sealed interface.
    void
    initContext(be.appify.prefab.processor.PrefabContext context)
     
    static boolean
    isAvroUnion(be.appify.prefab.processor.TypeManifest type)
    Returns true when type is a sealed interface generated by AvscEventWriter to represent an Avro multi-branch union field.
    void
    writeAdditionalFiles(List<be.appify.prefab.processor.ClassManifest> manifests)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface be.appify.prefab.processor.PrefabPlugin

    additionalFileEventScope, avroSchemaOf, dataTypeOf, fromAvroValueOf, getPolymorphicServiceDependencies, getServiceDependencies, mapRequestParameter, requestBodyParameter, requestMethodParameter, toAvroValueOf, writeAdditionalFiles, writeController, writeEventFiles, writeGlobalFiles, writePolymorphicController, writePolymorphicService, writePolymorphicTestClient, writeRepository, writeService, writeTestClient
  • Constructor Details

    • AvroPlugin

      public AvroPlugin()
  • Method Details

    • initContext

      public void initContext(be.appify.prefab.processor.PrefabContext context)
      Specified by:
      initContext in interface be.appify.prefab.processor.PrefabPlugin
    • writeAdditionalFiles

      public void writeAdditionalFiles(List<be.appify.prefab.processor.ClassManifest> manifests)
      Specified by:
      writeAdditionalFiles in interface be.appify.prefab.processor.PrefabPlugin
    • isAvroUnion

      public static boolean isAvroUnion(be.appify.prefab.processor.TypeManifest type)
      Returns true when type is a sealed interface generated by AvscEventWriter to represent an Avro multi-branch union field.

      The heuristic: a sealed interface with no Event annotation whose every permitted subtype is a single-value wrapper record.

    • avroUnionRecordBranches

      public static List<be.appify.prefab.processor.TypeManifest> avroUnionRecordBranches(be.appify.prefab.processor.TypeManifest unionType)
      Returns the nested-record component types from the permitted subtypes of an Avro union sealed interface. These are the types that require their own converters injected into the parent record's converters.