Class AvroPlugin
java.lang.Object
be.appify.prefab.avro.processor.AvroPlugin
- All Implemented Interfaces:
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 -
Method Summary
Modifier and TypeMethodDescriptionstatic 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.voidinitContext(be.appify.prefab.processor.PrefabContext context) static booleanisAvroUnion(be.appify.prefab.processor.TypeManifest type) Returnstruewhentypeis a sealed interface generated byAvscEventWriterto represent an Avro multi-branch union field.voidwriteAdditionalFiles(List<be.appify.prefab.processor.ClassManifest> manifests) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
initContextin interfacebe.appify.prefab.processor.PrefabPlugin
-
writeAdditionalFiles
- Specified by:
writeAdditionalFilesin interfacebe.appify.prefab.processor.PrefabPlugin
-
isAvroUnion
public static boolean isAvroUnion(be.appify.prefab.processor.TypeManifest type) Returnstruewhentypeis a sealed interface generated byAvscEventWriterto represent an Avro multi-branch union field.The heuristic: a sealed interface with no
Eventannotation 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.
-