001package Torello.JSON; 002 003import static javax.json.JsonValue.ValueType.OBJECT; 004 005import javax.json.*; 006 007import Torello.JSON.JsonBindingObjException; 008 009/** 010 * Used to indicate that one of the properties within a {@link JsonObject} was a parsed or valid 011 * {@link JsonObject}, but a User-Provided Builder-Function, or a 012 * {@code JsonObject}-Constructor, has failed to build a POJO instance (using the extracted 013 * {@code JsonObject}) and has thrown instead. 014 * 015 * <EMBED CLASS=globalDefs DATA-STRUCT=JsonObject DATA-TYPE=Object DATA-TYPE_ABBREV=Obj> 016 * <EMBED CLASS='external-html' DATA-FILE-ID=JE_FIELD_OBJ> 017 * <EMBED CLASS='external-html' DATA-FILE-ID=JE_MSG> 018 * <EMBED CLASS='external-html' DATA-FILE-ID=JE_MSG_JBPOEX> 019 */ 020@Torello.JavaDoc.Annotations.JDHeaderBackgroundImg(EmbedTagFileID="JE_BP_UL") 021@Torello.JavaDoc.Annotations.CSSLinks(FileNames="JSONExceptions.css") 022public class JsonBuildPOJOObjException extends JsonBindingObjException 023{ 024 /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUIDEX> */ 025 public static final long serialVersionUID = 1; 026 027 /** 028 * Constructs a {@code JsonBuildPOJOObjException} with no specified detail messsage, 029 * and the user-provided convenience-field values. 030 * 031 * @param cause The exception thrown by the user-provided constructor or builder function 032 * @param errorSourceJsonObject <EMBED CLASS='external-html' DATA-FILE-ID=JBEX_ESJO> 033 * @param propertyName <EMBED CLASS='external-html' DATA-FILE-ID=JBEX_PN> 034 * @param joRetrieved <EMBED CLASS='external-html' DATA-FILE-ID=JBEX_JO_RETRIEVED> 035 * @param methodReturnJavaType <EMBED CLASS='external-html' DATA-FILE-ID=JBEX_MRJT> 036 */ 037 public JsonBuildPOJOObjException( 038 Throwable cause, 039 JsonObject errorSourceJsonObject, 040 String propertyName, 041 JsonObject joRetrieved, 042 Class<?> methodReturnJavaType 043 ) 044 { 045 super( 046 cause, 047 errorSourceJsonObject, // Source JsonObject 048 propertyName, // JsonObject Property Name 049 OBJECT, // Expected Type 050 joRetrieved, // Encountered JsonObject which failed to build 051 methodReturnJavaType, // User Requested POJO Type 052 053 "Constructing a POJO instance from a JsonArray-Element has thrown an exception" 054 ); 055 } 056 057 /** 058 * Constructs a {@code JsonBuildPOJOObjException} with the specified detail message, and 059 * user-provided convenience-field values. 060 * 061 * @param message the detail message. 062 * @param cause The exception thrown by the user-provided constructor or builder function 063 * @param errorSourceJsonObject <EMBED CLASS='external-html' DATA-FILE-ID=JBEX_ESJO> 064 * @param propertyName <EMBED CLASS='external-html' DATA-FILE-ID=JBEX_PN> 065 * @param joRetrieved <EMBED CLASS='external-html' DATA-FILE-ID=JBEX_JO_RETRIEVED> 066 * @param methodReturnJavaType <EMBED CLASS='external-html' DATA-FILE-ID=JBEX_MRJT> 067 */ 068 public JsonBuildPOJOObjException( 069 String message, 070 Throwable cause, 071 JsonObject errorSourceJsonObject, 072 String propertyName, 073 JsonObject joRetrieved, 074 Class<?> methodReturnJavaType 075 ) 076 { 077 super( 078 message, 079 cause, 080 errorSourceJsonObject, // Source JsonObject 081 propertyName, // JsonObject Property Name 082 OBJECT, // Expected Type 083 joRetrieved, // Encountered JsonObject which failed to build 084 methodReturnJavaType // User Requested POJO Type 085 ); 086 } 087}