Package io.quarkus.arc.processor
Class RuntimeTypeCreator
java.lang.Object
io.quarkus.arc.processor.RuntimeTypeCreator
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 Summary
Modifier and TypeMethodDescriptionio.quarkus.gizmo2.LocalVarcreate(org.jboss.jandex.Type type) Returns a runtime representation of the given build-time type.static RuntimeTypeCreatorof(io.quarkus.gizmo2.creator.BlockCreator bc) Returns aRuntimeTypeCreatorfor the given block.withCache(io.quarkus.gizmo2.Var cache) withIndex(org.jboss.jandex.IndexView index) Returns a newRuntimeTypeCreatorwith the givenIndexViewwithTCCL(io.quarkus.gizmo2.Var tccl) Returns a newRuntimeTypeCreatorwith the giventccl.
-
Method Details
-
of
Returns aRuntimeTypeCreatorfor the given block. It may not be used outside of that block creator.- Parameters:
bc- the block creator, must not benull- Returns:
- a new runtime type creator
-
withIndex
Returns a newRuntimeTypeCreatorwith the givenIndexViewThe other properties are taken from this instance.
- Parameters:
index- the index, must not benull- Returns:
- a new runtime type creator
-
withCache
Returns a newRuntimeTypeCreatorwith the givencacheas the backingMapof a type cache.The other properties are taken from this instance.
- Parameters:
cache- the type cache, must not benulland must represent a variable of typeMap- Returns:
- a new runtime type creator
-
withTCCL
Returns a newRuntimeTypeCreatorwith the giventccl. The local variabletcclmust be in scope in the block for which thisRuntimeTypeCreatorwas created.The other properties are taken from this instance.
- Parameters:
tccl- the current thread's context class loader, must not benull- 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 benull- Returns:
- the runtime type as a Gizmo 2 local variable, never
null
-