Skip to content

LazyGeneration

Jonathan edited this page Jan 11, 2018 · 1 revision

When @LazyGeneration is present on a factory function, the factory generator will generate a implementation that creates event lazily (in other words, in the first time you invoke the factory function). This means that the event class will not be generated with factory and also that the event constructor will not be invoked directly, instead it will be invoked using either Reflection or MethodHandle, see Generator Options.

To annotate factory generated by EventSys APT with this annotation you need to set @Factory.lazy to true.