001package Torello.Java.JSON;
002
003import javax.json.*;
004
005/**
006 * Used to indicate that one of the elements within a {@link JsonArray} contained
007 * <B STYLE='color: red;'>Json Null</B>, when it was expected to contain a valid
008 * <B STYLE='color: red;'>Json-Type</B>.  There are several convenience field-constants provided
009 * by the parent-classes of this exception.
010 * 
011 * <EMBED CLASS=globalDefs DATA-STRUCT=JsonArray DATA-TYPE=Array DATA-TYPE_ABBREV=Arr>
012 * <EMBED CLASS='external-html' DATA-FILE-ID=JE_FIELD_ARR>
013 * <EMBED CLASS='external-html' DATA-FILE-ID=JE_MSG>
014 * <EMBED CLASS='external-html' DATA-FILE-ID=JE_MSG_JNAEX>
015 */
016@Torello.JavaDoc.JDHeaderBackgroundImg(EmbedTagFileID="JE_N_UL")
017@Torello.JavaDoc.CSSLinks(FileNames="JSONExceptions.css")
018public class JsonNullArrException extends JsonBindingArrException
019{
020    /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUIDEX>  */
021    public static final long serialVersionUID = 1;
022
023    /**
024     * Constructs a {@code JsonNullArrException} with no specified detail messsage,
025     * and the user-provided convenience-field values.
026     * 
027     * @param errorSourceJsonArray  <EMBED CLASS='external-html' DATA-FILE-ID=JBEX_ESJA>
028     * @param index                 <EMBED CLASS='external-html' DATA-FILE-ID=JBEX_I>
029     * @param expectedJsonType      <EMBED CLASS='external-html' DATA-FILE-ID=JBEX_EJT>
030     * @param methodReturnJavaType  <EMBED CLASS='external-html' DATA-FILE-ID=JBEX_MRJT>
031     */
032    public JsonNullArrException(
033            JsonArray           errorSourceJsonArray,
034            int                 index,
035            JsonValue.ValueType expectedJsonType,
036            Class<?>            methodReturnJavaType
037        )
038    {
039        super(
040            errorSourceJsonArray, index, expectedJsonType, JsonValue.NULL,
041            methodReturnJavaType, "An Array-Element Contained Json-Null"
042        );
043    }
044
045    /**
046     * Constructs a {@code JsonNullArrException} with the specified detail message, and
047     * user-provided convenience-field values.
048     * 
049     * @param message the detail message.
050     * @param errorSourceJsonArray  <EMBED CLASS='external-html' DATA-FILE-ID=JBEX_ESJA>
051     * @param index                 <EMBED CLASS='external-html' DATA-FILE-ID=JBEX_I>
052     * @param expectedJsonType      <EMBED CLASS='external-html' DATA-FILE-ID=JBEX_EJT>
053     * @param methodReturnJavaType  <EMBED CLASS='external-html' DATA-FILE-ID=JBEX_MRJT>
054     */
055    public JsonNullArrException(
056            String              message,
057            JsonArray           errorSourceJsonArray,
058            int                 index,
059            JsonValue.ValueType expectedJsonType,
060            Class<?>            methodReturnJavaType
061        )
062    {
063        super(
064            message, errorSourceJsonArray, index, expectedJsonType, JsonValue.NULL,
065            methodReturnJavaType
066        );
067    }
068}