Package io.quarkus.arc.processor
Class AnnotationLiteralProcessor
- java.lang.Object
-
- io.quarkus.arc.processor.AnnotationLiteralProcessor
-
public class AnnotationLiteralProcessor extends Object
Handles generating bytecode for annotation literals. Thecreate()method can be used to generate a bytecode sequence for instantiating an annotation literal.Behind the scenes, for each annotation literal, its class is also generated. This class is a subclass of
AnnotationLiteraland hence can be used at runtime. The generated annotation literal classes are shared. That is, one class is generated for each annotation type and the constructor of that class accepts values of all annotation members.This construct is thread-safe.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description io.quarkus.gizmo.ResultHandlecreate(io.quarkus.gizmo.BytecodeCreator bytecode, org.jboss.jandex.ClassInfo annotationClass, org.jboss.jandex.AnnotationInstance annotationInstance)Generates a bytecode sequence to create an instance of given annotation type, such that the annotation members have the same values as the given annotation instance.io.quarkus.gizmo.ResultHandleprocess(io.quarkus.gizmo.BytecodeCreator bytecode, io.quarkus.gizmo.ClassOutput classOutput, org.jboss.jandex.ClassInfo annotationClass, org.jboss.jandex.AnnotationInstance annotationInstance, String targetPackage)Deprecated.annotation literal sharing is now always enabled, this method is superseded bycreate(BytecodeCreator, ClassInfo, AnnotationInstance)and will be removed at some time after Quarkus 3.0
-
-
-
Method Detail
-
process
@Deprecated public io.quarkus.gizmo.ResultHandle process(io.quarkus.gizmo.BytecodeCreator bytecode, io.quarkus.gizmo.ClassOutput classOutput, org.jboss.jandex.ClassInfo annotationClass, org.jboss.jandex.AnnotationInstance annotationInstance, String targetPackage)
Deprecated.annotation literal sharing is now always enabled, this method is superseded bycreate(BytecodeCreator, ClassInfo, AnnotationInstance)and will be removed at some time after Quarkus 3.0
-
create
public io.quarkus.gizmo.ResultHandle create(io.quarkus.gizmo.BytecodeCreator bytecode, org.jboss.jandex.ClassInfo annotationClass, org.jboss.jandex.AnnotationInstance annotationInstance)Generates a bytecode sequence to create an instance of given annotation type, such that the annotation members have the same values as the given annotation instance. An implementation of the annotation type will be generated automatically, subclassing theAnnotationLiteralclass. Therefore, we also call it the annotation literal class.- Parameters:
bytecode- will receive the bytecode sequence for instantiating the annotation literal class as a sequence ofBytecodeCreatormethod callsannotationClass- the annotation typeannotationInstance- the annotation instance; must match theannotationClass- Returns:
- an annotation literal instance result handle
-
-