001package Torello.Java.JSON; 002 003import javax.json.*; 004 005/** 006 * Used to indicate that one of the indices within a {@link JsonArray} contained a different type 007 * than was requested / expected by the reader. There are several convenience field-constants 008 * provided by 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_JTAEX> 014 */ 015@Torello.JavaDoc.JDHeaderBackgroundImg(EmbedTagFileID="JE_T_UL") 016@Torello.JavaDoc.CSSLinks(FileNames="JSONExceptions.css") 017public class JsonTypeArrException 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 JsonTypeArrException} 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 valueRetrieved <EMBED CLASS='external-html' DATA-FILE-ID=JBEX_VR> 030 * @param methodReturnJavaType <EMBED CLASS='external-html' DATA-FILE-ID=JBEX_MRJT> 031 */ 032 public JsonTypeArrException( 033 JsonArray errorSourceJsonArray, 034 int index, 035 JsonValue.ValueType expectedJsonType, 036 JsonValue valueRetrieved, 037 Class<?> methodReturnJavaType 038 ) 039 { 040 super( 041 errorSourceJsonArray, index, expectedJsonType, valueRetrieved, 042 methodReturnJavaType, "A JsonArray index contained an unexpected Json-Type" 043 ); 044 } 045 046 /** 047 * Constructs a {@code JsonTypeArrException} with the specified detail message, and 048 * user-provided convenience-field values. 049 * 050 * @param message the detail message. 051 * @param errorSourceJsonArray <EMBED CLASS='external-html' DATA-FILE-ID=JBEX_ESJA> 052 * @param index <EMBED CLASS='external-html' DATA-FILE-ID=JBEX_I> 053 * @param expectedJsonType <EMBED CLASS='external-html' DATA-FILE-ID=JBEX_EJT> 054 * @param valueRetrieved <EMBED CLASS='external-html' DATA-FILE-ID=JBEX_VR> 055 * @param methodReturnJavaType <EMBED CLASS='external-html' DATA-FILE-ID=JBEX_MRJT> 056 */ 057 public JsonTypeArrException( 058 String message, 059 JsonArray errorSourceJsonArray, 060 int index, 061 JsonValue.ValueType expectedJsonType, 062 JsonValue valueRetrieved, 063 Class<?> methodReturnJavaType 064 ) 065 { 066 super( 067 message, errorSourceJsonArray, index, expectedJsonType, valueRetrieved, 068 methodReturnJavaType 069 ); 070 } 071}