1/* 2 * Licensed to the Apache Software Foundation (ASF) under one or more 3 * contributor license agreements. See the NOTICE file distributed with this 4 * work for additional information regarding copyright ownership. The ASF 5 * licenses this file to you under the Apache License, Version 2.0 (the 6 * "License"); you may not use this file except in compliance with the License. 7 * You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 * License for the specific language governing permissions and limitations under 15 * the License. 16 */ 17 18package java.lang.annotation; 19 20/** 21 * Indicates that an annotation in the binary representation of a class is 22 * syntactically incorrect and the annotation parser is unable to process it. 23 * This exception is unlikely to ever occur, given that the code has been 24 * compiled by an ordinary Java compiler. 25 * 26 * @since 1.5 27 */ 28public class AnnotationFormatError extends Error { 29 30 private static final long serialVersionUID = -4256701562333669892L; 31 32 /** 33 * Constructs an instance with the message provided. 34 * 35 * @param message 36 * the details of the error. 37 */ 38 public AnnotationFormatError(String message) { 39 super(message); 40 } 41 42 /** 43 * Constructs an instance with a message and a cause. 44 * 45 * @param message 46 * the details of the error. 47 * @param cause 48 * the cause of the error or {@code null} if none. 49 */ 50 public AnnotationFormatError(String message, Throwable cause) { 51 super(message, cause); 52 } 53 54 /** 55 * Constructs an instance with a cause. If the cause is not 56 * {@code null}, then {@code cause.toString()} is used as the 57 * error's message. 58 * 59 * @param cause 60 * the cause of the error or {@code null} if none. 61 */ 62 public AnnotationFormatError(Throwable cause) { 63 super(cause == null ? null : cause.toString(), cause); 64 } 65 66} 67