Top Description Fields Constructors Methods
org.jboss.jandex

public final Class AnnotationInstanceBuilder

extends Object
Class Inheritance
Imports
java.util.ArrayList, .HashSet, .List, .Set, java.util.function.Consumer

Builder for AnnotationInstance. Instances of the builder are not reusable.

Expected usage is: call add() as many times as required to add annotation members, and then call build() to create an AnnotationInstance without target, or buildWithTarget() to create an AnnotationInstance with target. Attempt to add() a member with the same name multiple times leads to an exception.

This builder does not check whether the annotation type declares a member with given name or whether that member declares a default value.

Field Summary

Modifier and TypeField and Description
private final Set<String>
private final DotName
private final boolean
private static final String
private final List<AnnotationValue>

Constructor Summary

AccessConstructor and Description
pack-priv
AnnotationInstanceBuilder(DotName annotationType, boolean runtimeVisible)

Method Summary

Modifier and TypeMethod and Description
public AnnotationInstanceBuilder

Returns:

this builder
add
(AnnotationValue
the pre-defined annotation member, must not be null
value
)

Adds a pre-defined annotation member whose name and value are defined by given value.

public AnnotationInstanceBuilder

Returns:

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

Adds a boolean-valued annotation member with given name.

public AnnotationInstanceBuilder

Returns:

this builder
add
(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 AnnotationInstanceBuilder

Returns:

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

Adds a byte-valued annotation member with given name.

public AnnotationInstanceBuilder

Returns:

this builder
add
(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 AnnotationInstanceBuilder

Returns:

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

Adds a short-valued annotation member with given name.

public AnnotationInstanceBuilder

Returns:

this builder
add
(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 AnnotationInstanceBuilder

Returns:

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

Adds an int-valued annotation member with given name.

public AnnotationInstanceBuilder

Returns:

this builder
add
(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 AnnotationInstanceBuilder

Returns:

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

Adds a long-valued annotation member with given name.

public AnnotationInstanceBuilder

Returns:

this builder
add
(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 AnnotationInstanceBuilder

Returns:

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

Adds a float-valued annotation member with given name.

public AnnotationInstanceBuilder

Returns:

this builder
add
(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 AnnotationInstanceBuilder

Returns:

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

Adds a double-valued annotation member with given name.

public AnnotationInstanceBuilder

Returns:

this builder
add
(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 AnnotationInstanceBuilder

Returns:

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

Adds a char-valued annotation member with given name.

public AnnotationInstanceBuilder

Returns:

this builder
add
(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 AnnotationInstanceBuilder

Returns:

this builder
add
(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 AnnotationInstanceBuilder

Returns:

this builder
add
(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 AnnotationInstanceBuilder

Returns:

this builder
add
(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 AnnotationInstanceBuilder

Returns:

this builder
add
(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 AnnotationInstanceBuilder

Returns:

this builder
add
(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 AnnotationInstanceBuilder

Returns:

this builder
add
(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 AnnotationInstanceBuilder

Returns:

this builder
add
(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 AnnotationInstanceBuilder

Returns:

this builder
add
(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 AnnotationInstanceBuilder

Returns:

this builder
add
(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 AnnotationInstanceBuilder

Returns:

this builder
add
(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 AnnotationInstanceBuilder

Returns:

this builder
add
(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 AnnotationInstanceBuilder

Returns:

this builder
add
(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 AnnotationInstanceBuilder

Returns:

this builder
add
(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 AnnotationInstanceBuilder

Returns:

this builder
add
(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 AnnotationInstanceBuilder

Returns:

this builder
add
(String
the member name, must not be null
name
,
AnnotationInstance
the annotation value, must not be null
value
)

Adds an annotation-valued annotation member with given name.

public AnnotationInstanceBuilder

Returns:

this builder
add
(String
the member name, must not be null
name
,
AnnotationInstance[]
the annotation array, must not be null or contain null
values
)

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

public AnnotationInstanceBuilder

Returns:

this builder
addAll
(List<AnnotationValue>
the pre-defined annotation members, must not be null or contain null
values
)

Adds all pre-defined annotation members whose names and values are defined by given values.

public AnnotationInstance

Returns:

the built AnnotationInstance, never null
build
()

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

public AnnotationInstance

Returns:

the built AnnotationInstance, never null
buildWithTarget
(AnnotationTarget
the target of the built annotation instance; if null, the built annotation instance has no target
target
)

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

private void
public AnnotationInstanceBuilder

Returns:

this builder
value
(boolean
the boolean value
value
)

Adds a boolean-valued annotation member called value.

public AnnotationInstanceBuilder

Returns:

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

Adds a boolean array-valued annotation member called value.

public AnnotationInstanceBuilder

Returns:

this builder
value
(byte
the byte value
value
)

Adds a byte-valued annotation member called value.

public AnnotationInstanceBuilder

Returns:

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

Adds a byte array-valued annotation member called value.

public AnnotationInstanceBuilder

Returns:

this builder
value
(short
the short value
value
)

Adds a short-valued annotation member called value.

public AnnotationInstanceBuilder

Returns:

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

Adds a short array-valued annotation member called value.

public AnnotationInstanceBuilder

Returns:

this builder
value
(int
the int value
value
)

Adds an int-valued annotation member called value.

public AnnotationInstanceBuilder

Returns:

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

Adds an int array-valued annotation member called value.

public AnnotationInstanceBuilder

Returns:

this builder
value
(long
the long value
value
)

Adds a long-valued annotation member called value.

public AnnotationInstanceBuilder

Returns:

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

Adds a long array-valued annotation member called value.

public AnnotationInstanceBuilder

Returns:

this builder
value
(float
the float value
value
)

Adds a float-valued annotation member called value.

public AnnotationInstanceBuilder

Returns:

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

Adds a float array-valued annotation member called value.

public AnnotationInstanceBuilder

Returns:

this builder
value
(double
the double value
value
)

Adds a double-valued annotation member called value.

public AnnotationInstanceBuilder

Returns:

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

Adds a double array-valued annotation member called value.

public AnnotationInstanceBuilder

Returns:

this builder
value
(char
the char value
value
)

Adds a char-valued annotation member called value.

public AnnotationInstanceBuilder

Returns:

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

Adds a char array-valued annotation member called value.

public AnnotationInstanceBuilder

Returns:

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

Adds a String-valued annotation member called value.

public AnnotationInstanceBuilder

Returns:

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

Adds a String array-valued annotation member called value.

public AnnotationInstanceBuilder

Returns:

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

Adds an enum-valued annotation member called value.

public AnnotationInstanceBuilder

Returns:

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

Adds an enum array-valued annotation member called value.

public AnnotationInstanceBuilder

Returns:

this builder
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 AnnotationInstanceBuilder

Returns:

this builder
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 AnnotationInstanceBuilder

Returns:

this builder
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 AnnotationInstanceBuilder

Returns:

this builder
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 AnnotationInstanceBuilder

Returns:

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

Adds a class-valued annotation member called value.

public AnnotationInstanceBuilder

Returns:

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

Adds a class array-valued annotation member called value.

public AnnotationInstanceBuilder

Returns:

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

Adds a class-valued annotation member called value.

public AnnotationInstanceBuilder

Returns:

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

Adds a class array-valued annotation member called value.

public AnnotationInstanceBuilder

Returns:

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

Adds a class-valued annotation member called value.

public AnnotationInstanceBuilder

Returns:

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

Adds a class array-valued annotation member called value.

public AnnotationInstanceBuilder

Returns:

this builder
value
(AnnotationInstance
the annotation value, must not be null
value
)

Adds an annotation-valued annotation member called value.

public AnnotationInstanceBuilder

Returns:

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

Adds an annotation array-valued annotation member called value.

public AnnotationInstanceBuilder

Returns:

this builder
with
(Consumer<AnnotationInstanceBuilder>
an action to be performed on this builder, must not be null
action
)

Calls given action with this builder as an argument, and returns this builder after the action finishes.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait