Package io.quarkus.gizmo
Interface AnnotationCreator
-
- All Known Implementing Classes:
AnnotationCreatorImpl
public interface AnnotationCreator
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default AnnotationCreatoradd(java.lang.String name, java.lang.Object value)Same asaddValue(String, Object), but returnsthisto allow fluent usage.voidaddValue(java.lang.String name, java.lang.Object value)Add a new annotation element with the givennameandvalue.static AnnotationCreatorof(java.lang.Class<?> annotationType)Returns anAnnotationCreatorfor annotation of givenannotationType.static AnnotationCreatorof(java.lang.String annotationType)Returns anAnnotationCreatorfor annotation of givenannotationType.static AnnotationCreatorof(java.lang.String annotationType, java.lang.annotation.RetentionPolicy retentionPolicy)Returns anAnnotationCreatorfor annotation of givenannotationTypewhich has givenretentionPolicy.
-
-
-
Method Detail
-
of
static AnnotationCreator of(java.lang.String annotationType)
Returns anAnnotationCreatorfor annotation of givenannotationType.Useful for representing nested annotations (see
addValue).- Parameters:
annotationType- class name of the annotation to create, must not benull- Returns:
- an
AnnotationCreator, nevernull
-
of
static AnnotationCreator of(java.lang.Class<?> annotationType)
Returns anAnnotationCreatorfor annotation of givenannotationType.Useful for representing nested annotations (see
addValue).- Parameters:
annotationType- type of the annotation to create, must not benull- Returns:
- an
AnnotationCreator, nevernull
-
of
static AnnotationCreator of(java.lang.String annotationType, java.lang.annotation.RetentionPolicy retentionPolicy)
Returns anAnnotationCreatorfor annotation of givenannotationTypewhich has givenretentionPolicy.Useful for representing nested annotations (see
addValue).- Parameters:
annotationType- class name of the annotation to create, must not benullretentionPolicy- retention policy of the annotation type- Returns:
- an
AnnotationCreator, nevernull
-
add
default AnnotationCreator add(java.lang.String name, java.lang.Object value)
Same asaddValue(String, Object), but returnsthisto allow fluent usage.
-
addValue
void addValue(java.lang.String name, java.lang.Object value)Add a new annotation element with the givennameandvalue. The name may be any permissible annotation element name (for example,toStringorannotationTypeare invalid). The value may be:- primitive wrapper type
StringEnumClass- nested annotation as an
AnnotationCreatorcreated usingAnnotationCreator.of(), or as a JandexAnnotationInstance - array of previously mentioned types
AnnotationValue.- Parameters:
name- name of the annotation element to addvalue- value of the annotation element to add
-
-