Enum Class AnnotationValue.RenderingDispatcher
java.lang.Object
java.lang.Enum<AnnotationValue.RenderingDispatcher>
net.bytebuddy.description.annotation.AnnotationValue.RenderingDispatcher
- All Implemented Interfaces:
Serializable
,Comparable<AnnotationValue.RenderingDispatcher>
,Constable
- Enclosing interface:
AnnotationValue<T,
S>
public static enum AnnotationValue.RenderingDispatcher
extends Enum<AnnotationValue.RenderingDispatcher>
A rendering dispatcher is responsible for resolving annotation values to
String
representations.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionA rendering dispatcher for Java 14 onward.A rendering dispatcher for Java 17 onward.A rendering dispatcher for Java 19 onward.A rendering dispatcher for Java 9 onward.A rendering dispatcher for any VM previous to Java 9. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final String
The prefix text for describing a mistyped array property.private final char
The closing brace of an arrayString
representation.private final boolean
Iftrue
, annotation types are represented as integer rather then character value.static final AnnotationValue.RenderingDispatcher
The rendering dispatcher for the current VM.private final char
The opening brace of an arrayString
representation. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
RenderingDispatcher
(char openingBrace, char closingBrace, boolean componentAsInteger) Creates a new rendering dispatcher. -
Method Summary
Modifier and TypeMethodDescriptionResolves a string for representing an inconsistently typed array of an annotation property.toSourceString
(boolean value) Represents the suppliedboolean
value as aString
.toSourceString
(byte value) Represents the suppliedboolean
value as aString
.abstract String
toSourceString
(char value) Represents the suppliedchar
value as aString
.abstract String
toSourceString
(double value) Represents the supplieddouble
value as aString
.abstract String
toSourceString
(float value) Represents the suppliedfloat
value as aString
.toSourceString
(int value) Represents the suppliedint
value as aString
.abstract String
toSourceString
(long value) Represents the suppliedlong
value as aString
.toSourceString
(short value) Represents the suppliedshort
value as aString
.abstract String
toSourceString
(String value) toSourceString
(List<?> values) Represents the supplied list elements as aString
.abstract String
toSourceString
(TypeDescription value) Represents the suppliedTypeDescription
value as aString
.toTypeErrorString
(Class<?> type) Resolves a type to be represented in an error message for a mismatched type.Returns the enum constant of this class with the specified name.static AnnotationValue.RenderingDispatcher[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
LEGACY_VM
A rendering dispatcher for any VM previous to Java 9. -
JAVA_9_CAPABLE_VM
A rendering dispatcher for Java 9 onward. -
JAVA_14_CAPABLE_VM
A rendering dispatcher for Java 14 onward. -
JAVA_17_CAPABLE_VM
A rendering dispatcher for Java 17 onward. -
JAVA_19_CAPABLE_VM
A rendering dispatcher for Java 19 onward.
-
-
Field Details
-
ARRAY_PREFIX
The prefix text for describing a mistyped array property.- See Also:
-
CURRENT
The rendering dispatcher for the current VM. -
openingBrace
private final char openingBraceThe opening brace of an arrayString
representation. -
closingBrace
private final char closingBraceThe closing brace of an arrayString
representation. -
componentAsInteger
private final boolean componentAsIntegerIftrue
, annotation types are represented as integer rather then character value.
-
-
Constructor Details
-
RenderingDispatcher
private RenderingDispatcher(char openingBrace, char closingBrace, boolean componentAsInteger) Creates a new rendering dispatcher.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
toSourceString
Represents the suppliedboolean
value as aString
.- Parameters:
value
- Theboolean
value to render.- Returns:
- An appropriate
String
representation.
-
toSourceString
Represents the suppliedboolean
value as aString
.- Parameters:
value
- Theboolean
value to render.- Returns:
- An appropriate
String
representation.
-
toSourceString
Represents the suppliedshort
value as aString
.- Parameters:
value
- Theshort
value to render.- Returns:
- An appropriate
String
representation.
-
toSourceString
Represents the suppliedchar
value as aString
.- Parameters:
value
- Thechar
value to render.- Returns:
- An appropriate
String
representation.
-
toSourceString
Represents the suppliedint
value as aString
.- Parameters:
value
- Theint
value to render.- Returns:
- An appropriate
String
representation.
-
toSourceString
Represents the suppliedlong
value as aString
.- Parameters:
value
- Thelong
value to render.- Returns:
- An appropriate
String
representation.
-
toSourceString
Represents the suppliedfloat
value as aString
.- Parameters:
value
- Thefloat
value to render.- Returns:
- An appropriate
String
representation.
-
toSourceString
Represents the supplieddouble
value as aString
.- Parameters:
value
- Thedouble
value to render.- Returns:
- An appropriate
String
representation.
-
toSourceString
-
toSourceString
Represents the suppliedTypeDescription
value as aString
.- Parameters:
value
- TheTypeDescription
value to render.- Returns:
- An appropriate
String
representation.
-
toSourceString
Represents the supplied list elements as aString
.- Parameters:
values
- The elements to render where each element is represented by itsObject.toString()
representation.- Returns:
- An appropriate
String
representation.
-
toArrayErrorString
Resolves a string for representing an inconsistently typed array of an annotation property.- Parameters:
sort
- The sort of the inconsistent property.- Returns:
- A message to describe the component property.
-
toTypeErrorString
Resolves a type to be represented in an error message for a mismatched type.- Parameters:
type
- The represented type.- Returns:
- The name to represent.
-