Thrown when the annotation parser attempts to read an annotation
from a class file and determines that the annotation is malformed.
This error can be thrown by the {@linkplain java.lang.reflect.AnnotatedElement API used to read annotations
reflectively}.
Constructs a new AnnotationFormatError with the specified
cause and a detail message of
(cause == null ? null : cause.toString()) (which
typically contains the class and detail message of cause).
Returns an array containing all of the exceptions that were
suppressed, typically by the try-with-resources
statement, in order to deliver this exception.
Constructs a new AnnotationFormatError with the specified
detail message.
Parameters
message
the detail message.
public
AnnotationFormatError(String message, Throwable cause)
Constructs a new AnnotationFormatError with the specified
detail message and cause. Note that the detail message associated
with cause is not automatically incorporated in
this error's detail message.
Parameters
message
the detail message
cause
the cause (A null value is permitted, and
indicates that the cause is nonexistent or unknown.)
Constructs a new AnnotationFormatError with the specified
cause and a detail message of
(cause == null ? null : cause.toString()) (which
typically contains the class and detail message of cause).
Parameters
cause
the cause (A null value is permitted, and
indicates that the cause is nonexistent or unknown.)
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-07-10 UTC."],[],["`AnnotationFormatError` is thrown when an annotation parser detects a malformed annotation in a class file. This error is used by the `AnnotatedElement` API for reflective annotation reading. There are three constructors: one for a message, one for a message and a cause, and one for just a cause. It inherits methods from `Throwable`, including managing stack traces, causes, suppressed exceptions, and message retrieval, and it also inherits methods from `Object` class such as clone and equals.\n"]]