001package Torello.Java.JSON;
002
003import javax.json.*;
004
005/**
006 * Used to indicate that one of the properties within a {@link JsonObject} 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 by
009 * the parent-class of this exception, and an additional field provided here too.
010 * 
011 * <EMBED CLASS=globalDefs DATA-STRUCT=JsonObject DATA-TYPE=Object DATA-TYPE_ABBREV=Obj>
012 * <EMBED CLASS='external-html' DATA-FILE-ID=JE_FIELD_OBJ>
013 * <EMBED CLASS='external-html' DATA-FILE-ID=JE_MSG>
014 * <EMBED CLASS='external-html' DATA-FILE-ID=JE_MSG_JNOEX>
015 */
016@Torello.JavaDoc.JDHeaderBackgroundImg(EmbedTagFileID="JE_N_UL")
017@Torello.JavaDoc.CSSLinks(FileNames="JSONExceptions.css")
018public class JsonNullObjException extends JsonBindingObjException
019{
020    /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUIDEX>  */
021    public static final long serialVersionUID = 1;
022
023    /**
024     * Constructs a {@code JsonNullObjException} with no specified detail messsage,
025     * and the user-provided convenience-field values.
026     * 
027     * @param errorSourceJsonObject <EMBED CLASS='external-html' DATA-FILE-ID=JBEX_ESJO>
028     * @param propertyName          <EMBED CLASS='external-html' DATA-FILE-ID=JBEX_PN>
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 JsonNullObjException(
033            JsonObject          errorSourceJsonObject,
034            String              propertyName,
035            JsonValue.ValueType expectedJsonType,
036            Class<?>            methodReturnJavaType
037        )
038    {
039        super(
040            errorSourceJsonObject, propertyName, expectedJsonType, JsonValue.NULL,
041            methodReturnJavaType, "An Object-Property Contained Json-Null"
042        );
043    }
044
045    /**
046     * Constructs a {@code JsonNullObjException} with the specified detail message, and
047     * user-provided convenience-field values.
048     * 
049     * @param message the detail message.
050     * @param errorSourceJsonObject <EMBED CLASS='external-html' DATA-FILE-ID=JBEX_ESJO>
051     * @param propertyName          <EMBED CLASS='external-html' DATA-FILE-ID=JBEX_PN>
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 JsonNullObjException(
056            String              message,
057            JsonObject          errorSourceJsonObject,
058            String              propertyName,
059            JsonValue.ValueType expectedJsonType,
060            Class<?>            methodReturnJavaType
061        )
062    {
063        super(
064            message, errorSourceJsonObject, propertyName, expectedJsonType, JsonValue.NULL,
065            methodReturnJavaType
066        );
067    }
068}