Top Description Methods
jakarta.enterprise.inject.build.compatible.spi

public Interface AnnotationBuilder

Imports
jakarta.enterprise.lang.model.AnnotationInfo, .AnnotationMember, jakarta.enterprise.lang.model.declarations.ClassInfo, jakarta.enterprise.lang.model.types.Type, java.lang.annotation.Annotation

Builder for annotations of given type. Expected usage is:
  1. create the builder using of(Class) or of(ClassInfo);
  2. use the value() and member() methods to define annotation members;
  3. call build() to create an AnnotationInfo.
One builder instance should not be used to create multiple annotations.

Note that values of all members of given annotation type must be defined before calling build(), except of annotation members that declare a default value. If a value is not defined for an annotation member that does not have a default value, build() will throw an exception.

Defining values of members that do not exist on given annotation type is possible, and such members will be retained in the resulting AnnotationInfo. However, if that AnnotationInfo is later transformed to an instance of the annotation type, the non-existing members will disappear.

Since
4.0

Method Summary

Modifier and TypeMethod and Description
public AnnotationInfo

Returns:

the built AnnotationInfo, never null
build
()

Returns an AnnotationInfo that includes all annotation members defined by previous method calls on this builder.

public AnnotationBuilder

Returns:

this AnnotationBuilder
member
(String
name of the annotation member, must not be null
name
,
AnnotationMember
value of the annotation member, must not be null
value
)

Adds an annotation member with given name, whose value is given value.

public AnnotationBuilder

Returns:

this AnnotationBuilder
member
(String
the member name, must not be null
name
,
boolean
the boolean value
value
)

Adds a boolean-valued annotation member with given name.

public AnnotationBuilder

Returns:

this AnnotationBuilder
member
(String
the member name, must not be null
name
,
boolean[]
the boolean array, must not be null
values
)

Adds a boolean array-valued annotation member with given name.

public AnnotationBuilder

Returns:

this AnnotationBuilder
member
(String
the member name, must not be null
name
,
byte
the byte value
value
)

Adds a byte-valued annotation member with given name.

public AnnotationBuilder

Returns:

this AnnotationBuilder
member
(String
the member name, must not be null
name
,
byte[]
the byte array, must not be null
values
)

Adds a byte array-valued annotation member with given name.

public AnnotationBuilder

Returns:

this AnnotationBuilder
member
(String
the member name, must not be null
name
,
short
the short value
value
)

Adds a short-valued annotation member with given name.

public AnnotationBuilder

Returns:

this AnnotationBuilder
member
(String
the member name, must not be null
name
,
short[]
the short array, must not be null
values
)

Adds a short array-valued annotation member with given name.

public AnnotationBuilder

Returns:

this AnnotationBuilder
member
(String
the member name, must not be null
name
,
int
the int value
value
)

Adds an int-valued annotation member with given name.

public AnnotationBuilder

Returns:

this AnnotationBuilder
member
(String
the member name, must not be null
name
,
int[]
the int array, must not be null
values
)

Adds an int array-valued annotation member with given name.

public AnnotationBuilder

Returns:

this AnnotationBuilder
member
(String
the member name, must not be null
name
,
long
the long value
value
)

Adds a long-valued annotation member with given name.

public AnnotationBuilder

Returns:

this AnnotationBuilder
member
(String
the member name, must not be null
name
,
long[]
the long array, must not be null
values
)

Adds a long array-valued annotation member with given name.

public AnnotationBuilder

Returns:

this AnnotationBuilder
member
(String
the member name, must not be null
name
,
float
the float value
value
)

Adds a float-valued annotation member with given name.

public AnnotationBuilder

Returns:

this AnnotationBuilder
member
(String
the member name, must not be null
name
,
float[]
the float array, must not be null
values
)

Adds a float array-valued annotation member with given name.

public AnnotationBuilder

Returns:

this AnnotationBuilder
member
(String
the member name, must not be null
name
,
double
the double value
value
)

Adds a double-valued annotation member with given name.

public AnnotationBuilder

Returns:

this AnnotationBuilder
member
(String
the member name, must not be null
name
,
double[]
the double array, must not be null
values
)

Adds a double array-valued annotation member with given name.

public AnnotationBuilder

Returns:

this AnnotationBuilder
member
(String
the member name, must not be null
name
,
char
the char value
value
)

Adds a char-valued annotation member with given name.

public AnnotationBuilder

Returns:

this AnnotationBuilder
member
(String
the member name, must not be null
name
,
char[]
the char array, must not be null
values
)

Adds a char array-valued annotation member with given name.

public AnnotationBuilder

Returns:

this AnnotationBuilder
member
(String
the member name, must not be null
name
,
String
the String value, must not be null
value
)

Adds a String-valued annotation member with given name.

public AnnotationBuilder

Returns:

this AnnotationBuilder
member
(String
the member name, must not be null
name
,
String[]
the String array, must not be null or contain null
values
)

Adds a String array-valued annotation member with given name.

public AnnotationBuilder

Returns:

this AnnotationBuilder
member
(String
the member name, must not be null
name
,
Enum<?>
the enum value, must not be null
value
)

Adds an enum-valued annotation member with given name.

public AnnotationBuilder

Returns:

this AnnotationBuilder
member
(String
the member name, must not be null
name
,
Enum<?>[]
the enum array, must not be null or contain null
values
)

Adds an enum array-valued annotation member with given name.

public AnnotationBuilder

Returns:

this AnnotationBuilder
member
(String
the member name, must not be null
name
,
Class<? extends Enum<?>>
the enum type, must not be null
enumType
,
String
name of the enum constant, must not be null
enumValue
)

Adds an enum-valued annotation member with given name.

public AnnotationBuilder

Returns:

this AnnotationBuilder
member
(String
the member name, must not be null
name
,
Class<? extends Enum<?>>
the enum type, must not be null
enumType
,
String[]
names of the enum constants, must not be null or contain null
enumValues
)

Adds an enum array-valued annotation member with given name.

public AnnotationBuilder

Returns:

this AnnotationBuilder
member
(String
the member name, must not be null
name
,
ClassInfo
the enum type, must not be null
enumType
,
String
name of the enum constant, must not be null
enumValue
)

Adds an enum-valued annotation member with given name.

public AnnotationBuilder

Returns:

this AnnotationBuilder
member
(String
the member name, must not be null
name
,
ClassInfo
the enum type, must not be null
enumType
,
String[]
names of the enum constants, must not be null or contain null
enumValues
)

Adds an enum array-valued annotation member with given name.

public AnnotationBuilder

Returns:

this AnnotationBuilder
member
(String
the member name, must not be null
name
,
Class<?>
the class value, must not be null
value
)

Adds a class-valued annotation member with given name.

public AnnotationBuilder

Returns:

this AnnotationBuilder
member
(String
the member name, must not be null
name
,
Class<?>[]
the class array, must not be null or contain null
values
)

Adds a class array-valued annotation member with given name.

public AnnotationBuilder

Returns:

this AnnotationBuilder
member
(String
the member name, must not be null
name
,
ClassInfo
the class value, must not be null
value
)

Adds a class-valued annotation member with given name.

public AnnotationBuilder

Returns:

this AnnotationBuilder
member
(String
the member name, must not be null
name
,
ClassInfo[]
the class array, must not be null or contain null
values
)

Adds a class array-valued annotation member with given name.

public AnnotationBuilder

Returns:

this AnnotationBuilder
member
(String
the member name, must not be null
name
,
Type
the class value, must not be null
value
)

Adds a class-valued annotation member with given name.

public AnnotationBuilder

Returns:

this AnnotationBuilder
member
(String
the member name, must not be null
name
,
Type[]
the class array, must not be null or contain null
values
)

Adds a class array-valued annotation member with given name.

public AnnotationBuilder

Returns:

this AnnotationBuilder
member
(String
the member name, must not be null
name
,
AnnotationInfo
the annotation value, must not be null
value
)

Adds an annotation-valued annotation member with given name.

public AnnotationBuilder

Returns:

this AnnotationBuilder
member
(String
the member name, must not be null
name
,
AnnotationInfo[]
the annotation array, must not be null or contain null
values
)

Adds an annotation array-valued annotation member with given name.

public AnnotationBuilder

Returns:

this AnnotationBuilder
member
(String
the member name, must not be null
name
,
Annotation
the annotation value, must not be null
value
)

Adds an annotation-valued annotation member with given name.

public AnnotationBuilder

Returns:

this AnnotationBuilder
member
(String
the member name, must not be null
name
,
Annotation[]
the annotation array, must not be null or contain null
values
)

Adds an annotation array-valued annotation member with given name.

public static AnnotationBuilder

Returns:

a new AnnotationBuilder, never null
of
(Class<? extends Annotation>
the annotation type, must not be null
annotationType
)

Returns a new AnnotationBuilder that builds an annotation of given type.

public static AnnotationBuilder

Returns:

a new AnnotationBuilder
of
(ClassInfo
the annotation type, must not be null
annotationType
)

Returns a new AnnotationBuilder that builds an annotation of given type.

public default AnnotationBuilder

Returns:

this AnnotationBuilder
value
(AnnotationMember
value of the annotation member
value
)

Adds an annotation member called value, whose value is given value.

public default AnnotationBuilder

Returns:

this AnnotationBuilder
value
(boolean
the boolean value
value
)

Adds a boolean-valued annotation member called value.

public default AnnotationBuilder

Returns:

this AnnotationBuilder
value
(boolean[]
the boolean array, must not be null
values
)

Adds a boolean array-valued annotation member called value.

public default AnnotationBuilder

Returns:

this AnnotationBuilder
value
(byte
the byte value
value
)

Adds a byte-valued annotation member called value.

public default AnnotationBuilder

Returns:

this AnnotationBuilder
value
(byte[]
the byte array, must not be null
values
)

Adds a byte array-valued annotation member called value.

public default AnnotationBuilder

Returns:

this AnnotationBuilder
value
(short
the short value
value
)

Adds a short-valued annotation member called value.

public default AnnotationBuilder

Returns:

this AnnotationBuilder
value
(short[]
the short array, must not be null
values
)

Adds a short array-valued annotation member called value.

public default AnnotationBuilder

Returns:

this AnnotationBuilder
value
(int
the int value
value
)

Adds an int-valued annotation member called value.

public default AnnotationBuilder

Returns:

this AnnotationBuilder
value
(int[]
the int array, must not be null
values
)

Adds an int array-valued annotation member called value.

public default AnnotationBuilder

Returns:

this AnnotationBuilder
value
(long
the long value
value
)

Adds a long-valued annotation member called value.

public default AnnotationBuilder

Returns:

this AnnotationBuilder
value
(long[]
the long array, must not be null
values
)

Adds a long array-valued annotation member called value.

public default AnnotationBuilder

Returns:

this AnnotationBuilder
value
(float
the float value
value
)

Adds a float-valued annotation member called value.

public default AnnotationBuilder

Returns:

this AnnotationBuilder
value
(float[]
the float array, must not be null
values
)

Adds a float array-valued annotation member called value.

public default AnnotationBuilder

Returns:

this AnnotationBuilder
value
(double
the double value
value
)

Adds a double-valued annotation member called value.

public default AnnotationBuilder

Returns:

this AnnotationBuilder
value
(double[]
the double array, must not be null
values
)

Adds a double array-valued annotation member called value.

public default AnnotationBuilder

Returns:

this AnnotationBuilder
value
(char
the char value
value
)

Adds a char-valued annotation member called value.

public default AnnotationBuilder

Returns:

this AnnotationBuilder
value
(char[]
the char array, must not be null
values
)

Adds a char array-valued annotation member called value.

public default AnnotationBuilder

Returns:

this AnnotationBuilder
value
(String
the String value, must not be null
value
)

Adds a String-valued annotation member called value.

public default AnnotationBuilder

Returns:

this AnnotationBuilder
value
(String[]
the String array, must not be null or contain null
values
)

Adds a String array-valued annotation member called value.

public default AnnotationBuilder

Returns:

this AnnotationBuilder
value
(Enum<?>
the enum value, must not be null
value
)

Adds an enum-valued annotation member called value.

public default AnnotationBuilder

Returns:

this AnnotationBuilder
value
(Enum<?>[]
the enum array, must not be null or contain null
values
)

Adds an enum array-valued annotation member called value.

public default AnnotationBuilder

Returns:

this AnnotationBuilder
value
(Class<? extends Enum<?>>
the enum type, must not be null
enumType
,
String
name of the enum constant, must not be null
enumValue
)

Adds an enum-valued annotation member called value.

public default AnnotationBuilder

Returns:

this AnnotationBuilder
value
(Class<? extends Enum<?>>
the enum type, must not be null
enumType
,
String[]
names of the enum constants, must not be null or contain null
enumValues
)

Adds an enum array-valued annotation member called value.

public default AnnotationBuilder

Returns:

this AnnotationBuilder
value
(ClassInfo
the enum type, must not be null
enumType
,
String
name of the enum constant, must not be null
enumValue
)

Adds an enum-valued annotation member called value.

public default AnnotationBuilder

Returns:

this AnnotationBuilder
value
(ClassInfo
the enum type, must not be null
enumType
,
String[]
names of the enum constants, must not be null or contain null
enumValues
)

Adds an enum array-valued annotation member called value.

public default AnnotationBuilder

Returns:

this AnnotationBuilder
value
(Class<?>
the class value, must not be null
value
)

Adds a class-valued annotation member called value.

public default AnnotationBuilder

Returns:

this AnnotationBuilder
value
(Class<?>[]
the class array, must not be null or contain null
values
)

Adds a class array-valued annotation member called value.

public default AnnotationBuilder

Returns:

this AnnotationBuilder
value
(ClassInfo
the class value, must not be null
value
)

Adds a class-valued annotation member called value.

public default AnnotationBuilder

Returns:

this AnnotationBuilder
value
(ClassInfo[]
the class array, must not be null or contain null
values
)

Adds a class array-valued annotation member called value.

public default AnnotationBuilder

Returns:

this AnnotationBuilder
value
(Type
the class value, must not be null
value
)

Adds a class-valued annotation member called value.

public default AnnotationBuilder

Returns:

this AnnotationBuilder
value
(Type[]
the class array, must not be null or contain null
values
)

Adds a class array-valued annotation member called value.

public default AnnotationBuilder

Returns:

this AnnotationBuilder
value
(AnnotationInfo
the annotation value, must not be null
value
)

Adds an annotation-valued annotation member called value.

public default AnnotationBuilder

Returns:

this AnnotationBuilder
value
(AnnotationInfo[]
the annotation array, must not be null or contain null
values
)

Adds an annotation array-valued annotation member called value.

public default AnnotationBuilder

Returns:

this AnnotationBuilder
value
(Annotation
the annotation value, must not be null
value
)

Adds an annotation-valued annotation member called value.

public default AnnotationBuilder

Returns:

this AnnotationBuilder
value
(Annotation[]
the annotation array, must not be null or contain null
values
)

Adds an annotation array-valued annotation member called value.