001package Torello.Java.JSON; 002 003import javax.json.*; 004 005/** 006 * Used to indicate that one of the indices within a {@link JsonArray} contained null, where a 007 * valid primitive-value was expected. There are several convenience field-constants provided by 008 * the parent-class of this exception, and an additional field provided here too. 009 * 010 * <EMBED CLASS=globalDefs DATA-STRUCT=JsonArray DATA-TYPE=Array DATA-TYPE_ABBREV=Arr> 011 * <EMBED CLASS='external-html' DATA-FILE-ID=JE_FIELD_ARR> 012 * <EMBED CLASS='external-html' DATA-FILE-ID=JE_MSG> 013 * <EMBED CLASS='external-html' DATA-FILE-ID=JE_MSG_JNPAEX> 014 */ 015@Torello.JavaDoc.JDHeaderBackgroundImg(EmbedTagFileID="JE_NP_UL") 016@Torello.JavaDoc.CSSLinks(FileNames="JSONExceptions.css") 017public class JsonNullPrimitiveArrException extends JsonBindingArrException 018{ 019 /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUIDEX> */ 020 public static final long serialVersionUID = 1; 021 022 /** 023 * Constructs a {@code JsonNullPrimitiveArrException} with no specified detail messsage, 024 * and the user-provided convenience-field values. 025 * 026 * @param errorSourceJsonArray <EMBED CLASS='external-html' DATA-FILE-ID=JBEX_ESJA> 027 * @param index <EMBED CLASS='external-html' DATA-FILE-ID=JBEX_I> 028 * @param expectedJsonType <EMBED CLASS='external-html' DATA-FILE-ID=JBEX_EJT> 029 * @param methodReturnJavaType <EMBED CLASS='external-html' DATA-FILE-ID=JBEX_MRJT> 030 */ 031 public JsonNullPrimitiveArrException( 032 JsonArray errorSourceJsonArray, 033 int index, 034 JsonValue.ValueType expectedJsonType, 035 Class<?> methodReturnJavaType 036 ) 037 { 038 super( 039 errorSourceJsonArray, index, expectedJsonType, JsonValue.NULL, 040 methodReturnJavaType, 041 "Attempt to assign Java-Null to a Java-Primitive Type" 042 ); 043 } 044 045 /** 046 * Constructs a {@code JsonNullPrimitiveArrException} 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 JsonNullPrimitiveArrException( 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}