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