Enum AnnotationValue.RenderingDispatcher
- java.lang.Object
-
- java.lang.Enum<AnnotationValue.RenderingDispatcher>
-
- net.bytebuddy.description.annotation.AnnotationValue.RenderingDispatcher
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<AnnotationValue.RenderingDispatcher>
- Enclosing interface:
- AnnotationValue<T,S>
public static enum AnnotationValue.RenderingDispatcher extends java.lang.Enum<AnnotationValue.RenderingDispatcher>
A rendering dispatcher is responsible for resolving annotation values toStringrepresentations.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description JAVA_14_CAPABLE_VMA rendering dispatcher for Java 14 onward.JAVA_17_CAPABLE_VMA rendering dispatcher for Java 17 onward.JAVA_19_CAPABLE_VMA rendering dispatcher for Java 19 onward.JAVA_9_CAPABLE_VMA rendering dispatcher for Java 9 onward.LEGACY_VMA rendering dispatcher for any VM previous to Java 9.
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.StringARRAY_PREFIXThe prefix text for describing a mistyped array property.private charclosingBraceThe closing brace of an arrayStringrepresentation.private booleancomponentAsIntegerIftrue, annotation types are represented as integer rather then character value.static AnnotationValue.RenderingDispatcherCURRENTThe rendering dispatcher for the current VM.private charopeningBraceThe opening brace of an arrayStringrepresentation.
-
Constructor Summary
Constructors Modifier Constructor Description privateRenderingDispatcher(char openingBrace, char closingBrace, boolean componentAsInteger)Creates a new rendering dispatcher.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.lang.StringtoArrayErrorString(AnnotationValue.Sort sort)Resolves a string for representing an inconsistently typed array of an annotation property.java.lang.StringtoSourceString(boolean value)Represents the suppliedbooleanvalue as aString.java.lang.StringtoSourceString(byte value)Represents the suppliedbooleanvalue as aString.abstract java.lang.StringtoSourceString(char value)Represents the suppliedcharvalue as aString.abstract java.lang.StringtoSourceString(double value)Represents the supplieddoublevalue as aString.abstract java.lang.StringtoSourceString(float value)Represents the suppliedfloatvalue as aString.java.lang.StringtoSourceString(int value)Represents the suppliedintvalue as aString.abstract java.lang.StringtoSourceString(long value)Represents the suppliedlongvalue as aString.java.lang.StringtoSourceString(short value)Represents the suppliedshortvalue as aString.abstract java.lang.StringtoSourceString(java.lang.String value)Represents the suppliedStringvalue as aString.java.lang.StringtoSourceString(java.util.List<?> values)Represents the supplied list elements as aString.abstract java.lang.StringtoSourceString(TypeDescription value)Represents the suppliedTypeDescriptionvalue as aString.java.lang.StringtoTypeErrorString(java.lang.Class<?> type)Resolves a type to be represented in an error message for a mismatched type.static AnnotationValue.RenderingDispatchervalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static AnnotationValue.RenderingDispatcher[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
LEGACY_VM
public static final AnnotationValue.RenderingDispatcher LEGACY_VM
A rendering dispatcher for any VM previous to Java 9.
-
JAVA_9_CAPABLE_VM
public static final AnnotationValue.RenderingDispatcher JAVA_9_CAPABLE_VM
A rendering dispatcher for Java 9 onward.
-
JAVA_14_CAPABLE_VM
public static final AnnotationValue.RenderingDispatcher JAVA_14_CAPABLE_VM
A rendering dispatcher for Java 14 onward.
-
JAVA_17_CAPABLE_VM
public static final AnnotationValue.RenderingDispatcher JAVA_17_CAPABLE_VM
A rendering dispatcher for Java 17 onward.
-
JAVA_19_CAPABLE_VM
public static final AnnotationValue.RenderingDispatcher JAVA_19_CAPABLE_VM
A rendering dispatcher for Java 19 onward.
-
-
Field Detail
-
ARRAY_PREFIX
private static final java.lang.String ARRAY_PREFIX
The prefix text for describing a mistyped array property.- See Also:
- Constant Field Values
-
CURRENT
public static final AnnotationValue.RenderingDispatcher CURRENT
The rendering dispatcher for the current VM.
-
openingBrace
private final char openingBrace
The opening brace of an arrayStringrepresentation.
-
closingBrace
private final char closingBrace
The closing brace of an arrayStringrepresentation.
-
componentAsInteger
private final boolean componentAsInteger
Iftrue, annotation types are represented as integer rather then character value.
-
-
Constructor Detail
-
RenderingDispatcher
private RenderingDispatcher(char openingBrace, char closingBrace, boolean componentAsInteger)Creates a new rendering dispatcher.- Parameters:
openingBrace- The opening brace of an arrayStringrepresentation.closingBrace- The closing brace of an arrayStringrepresentation.componentAsInteger- Iftrue, annotation types are represented as characters rather then integer values.
-
-
Method Detail
-
values
public static AnnotationValue.RenderingDispatcher[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (AnnotationValue.RenderingDispatcher c : AnnotationValue.RenderingDispatcher.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static AnnotationValue.RenderingDispatcher valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
toSourceString
public java.lang.String toSourceString(boolean value)
Represents the suppliedbooleanvalue as aString.- Parameters:
value- Thebooleanvalue to render.- Returns:
- An appropriate
Stringrepresentation.
-
toSourceString
public java.lang.String toSourceString(byte value)
Represents the suppliedbooleanvalue as aString.- Parameters:
value- Thebooleanvalue to render.- Returns:
- An appropriate
Stringrepresentation.
-
toSourceString
public java.lang.String toSourceString(short value)
Represents the suppliedshortvalue as aString.- Parameters:
value- Theshortvalue to render.- Returns:
- An appropriate
Stringrepresentation.
-
toSourceString
public abstract java.lang.String toSourceString(char value)
Represents the suppliedcharvalue as aString.- Parameters:
value- Thecharvalue to render.- Returns:
- An appropriate
Stringrepresentation.
-
toSourceString
public java.lang.String toSourceString(int value)
Represents the suppliedintvalue as aString.- Parameters:
value- Theintvalue to render.- Returns:
- An appropriate
Stringrepresentation.
-
toSourceString
public abstract java.lang.String toSourceString(long value)
Represents the suppliedlongvalue as aString.- Parameters:
value- Thelongvalue to render.- Returns:
- An appropriate
Stringrepresentation.
-
toSourceString
public abstract java.lang.String toSourceString(float value)
Represents the suppliedfloatvalue as aString.- Parameters:
value- Thefloatvalue to render.- Returns:
- An appropriate
Stringrepresentation.
-
toSourceString
public abstract java.lang.String toSourceString(double value)
Represents the supplieddoublevalue as aString.- Parameters:
value- Thedoublevalue to render.- Returns:
- An appropriate
Stringrepresentation.
-
toSourceString
public abstract java.lang.String toSourceString(java.lang.String value)
Represents the suppliedStringvalue as aString.- Parameters:
value- TheStringvalue to render.- Returns:
- An appropriate
Stringrepresentation.
-
toSourceString
public abstract java.lang.String toSourceString(TypeDescription value)
Represents the suppliedTypeDescriptionvalue as aString.- Parameters:
value- TheTypeDescriptionvalue to render.- Returns:
- An appropriate
Stringrepresentation.
-
toSourceString
public java.lang.String toSourceString(java.util.List<?> values)
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
Stringrepresentation.
-
toArrayErrorString
public java.lang.String toArrayErrorString(AnnotationValue.Sort sort)
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
public java.lang.String toTypeErrorString(java.lang.Class<?> type)
Resolves a type to be represented in an error message for a mismatched type.- Parameters:
type- The represented type.- Returns:
- The name to represent.
-
-