Class RuntimeTypeCreator

java.lang.Object
io.quarkus.arc.processor.RuntimeTypeCreator

public class RuntimeTypeCreator extends Object
Utility to create runtime representation of Jandex Types. In the code, the runtime values are Gizmo 2 LocalVars and at actual runtime, they implement Type (often, they're simply Classes).

The creator is created using of(BlockCreator) for the given Gizmo 2 BlockCreator and must be used only in that block.

The creator supports optional caching of type values (call withCache(Var)) and optional usage of a Jandex index to look up enclosing classes (call withIndex(IndexView)).

  • Method Details

    • of

      public static RuntimeTypeCreator of(io.quarkus.gizmo2.creator.BlockCreator bc)
      Returns a RuntimeTypeCreator for the given block. It may not be used outside of that block creator.
      Parameters:
      bc - the block creator, must not be null
      Returns:
      a new runtime type creator
    • withIndex

      public RuntimeTypeCreator withIndex(org.jboss.jandex.IndexView index)
      Returns a new RuntimeTypeCreator with the given IndexView

      The other properties are taken from this instance.

      Parameters:
      index - the index, must not be null
      Returns:
      a new runtime type creator
    • withCache

      public RuntimeTypeCreator withCache(io.quarkus.gizmo2.Var cache)
      Returns a new RuntimeTypeCreator with the given cache as the backing Map of a type cache.

      The other properties are taken from this instance.

      Parameters:
      cache - the type cache, must not be null and must represent a variable of type Map
      Returns:
      a new runtime type creator
    • withTCCL

      public RuntimeTypeCreator withTCCL(io.quarkus.gizmo2.Var tccl)
      Returns a new RuntimeTypeCreator with the given tccl. The local variable tccl must be in scope in the block for which this RuntimeTypeCreator was created.

      The other properties are taken from this instance.

      Parameters:
      tccl - the current thread's context class loader, must not be null
      Returns:
      a new runtime type creator
    • create

      public io.quarkus.gizmo2.LocalVar create(org.jboss.jandex.Type type)
      Returns a runtime representation of the given build-time type.
      Parameters:
      type - the Jandex type, must not be null
      Returns:
      the runtime type as a Gizmo 2 local variable, never null