001/* 002 * ============================================================================ 003 * Copyright © 2002-2024 by Thomas Thrien. 004 * All Rights Reserved. 005 * ============================================================================ 006 * Licensed to the public under the agreements of the GNU Lesser General Public 007 * License, version 3.0 (the "License"). You may obtain a copy of the License at 008 * 009 * http://www.gnu.org/licenses/lgpl.html 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 013 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 014 * License for the specific language governing permissions and limitations 015 * under the License. 016 */ 017 018package org.tquadrat.foundation.ap; 019 020import org.apiguardian.api.API; 021import org.tquadrat.foundation.annotation.ClassVersion; 022 023import java.io.Serial; 024 025import static org.apiguardian.api.API.Status.STABLE; 026import static org.tquadrat.foundation.lang.Objects.requireNonNullArgument; 027 028/** 029 * The error that will be thrown when there is a problem with the code 030 * generation during annotation processing. 031 * 032 * @extauthor Thomas Thrien - thomas.thrien@tquadrat.org 033 * @version $Id: CodeGenerationError.java 1117 2024-03-15 15:13:48Z tquadrat $ 034 * @since 0.0.1 035 * 036 * @UMLGraph.link 037 */ 038@ClassVersion( sourceVersion = "$Id: CodeGenerationError.java 1117 2024-03-15 15:13:48Z tquadrat $" ) 039@API( status = STABLE, since = "0.0.1" ) 040public final class CodeGenerationError extends AnnotationProcessingError 041{ 042 /*------------------------*\ 043 ====** Static Initialisations **=========================================== 044 \*------------------------*/ 045 /** 046 * The serial version UID for objects of this class: {@value}. 047 * 048 * @hidden 049 */ 050 @Serial 051 private static final long serialVersionUID = 1L; 052 053 /*--------------*\ 054 ====** Constructors **===================================================== 055 \*--------------*/ 056 /** 057 * Constructs a new error with {@code null} as its detail message. The 058 * cause is not initialised, and may subsequently be initialised by a call 059 * to 060 * {@link #initCause}. 061 */ 062 public CodeGenerationError() { super(); } 063 064 /** 065 * Constructs a new error with the specified detail message. The cause is 066 * not initialised, and may subsequently be initialised by a call to 067 * {@link #initCause}. 068 * 069 * @param message The detail message. It is saved for later retrieval by 070 * the 071 * {@link #getMessage()} 072 * method. 073 */ 074 public CodeGenerationError( final String message ) { super( requireNonNullArgument( message, "message" ) ); } 075 076 /** 077 * Constructs a new error with the specified detail message and cause.<br> 078 * <br>Note that the detail message associated with {@code cause} is 079 * <i>not</i> automatically incorporated in this error's detail message. 080 * 081 * @param message The detail message (which is saved for later retrieval 082 * by the 083 * {@link #getMessage()} 084 * method). 085 * @param cause The cause (which is saved for later retrieval by the 086 * {@link #getCause()} 087 * method). A {@code null} value is permitted, and indicates that the 088 * cause is nonexistent or unknown. 089 */ 090 public CodeGenerationError( final String message, final Throwable cause ) { super( requireNonNullArgument( message, "message" ), cause ); } 091 092 /** 093 * Constructs a new error with the specified cause and a detail message of 094 * {@code (cause==null ? null : cause.toString())} (which typically 095 * contains the class and detail message of {@code cause}).<br> 096 * <br>This constructor is useful for errors that are little more than 097 * wrappers for other instances of 098 * {@linkplain Throwable}. 099 * 100 * @param cause The cause (which is saved for later retrieval by the 101 * {@link #getCause()} 102 * method). A {@code null} value is permitted, and indicates that the 103 * cause is nonexistent or unknown. 104 */ 105 public CodeGenerationError( final Throwable cause ) { super( cause ); } 106} 107// class CodeGenerationError 108 109/* 110 * End of File 111 */