1 package edu.internet2.middleware.grouperClientExt.com.fasterxml.jackson.databind.exc;
2
3 import edu.internet2.middleware.grouperClientExt.com.fasterxml.jackson.core.JsonLocation;
4 import edu.internet2.middleware.grouperClientExt.com.fasterxml.jackson.core.JsonParser;
5 import edu.internet2.middleware.grouperClientExt.com.fasterxml.jackson.databind.JavaType;
6 import edu.internet2.middleware.grouperClientExt.com.fasterxml.jackson.databind.JsonMappingException;
7 import edu.internet2.middleware.grouperClientExt.com.fasterxml.jackson.databind.util.ClassUtil;
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 @SuppressWarnings("serial")
26 public class MismatchedInputException
27 extends JsonMappingException
28 {
29
30
31
32 protected Class<?> _targetType;
33
34 protected MismatchedInputException(JsonParser p, String msg) {
35 this(p, msg, (JavaType) null);
36 }
37
38 protected MismatchedInputException(JsonParser p, String msg, JsonLocation loc) {
39 super(p, msg, loc);
40 }
41
42 protected MismatchedInputException(JsonParser p, String msg, Class<?> targetType) {
43 super(p, msg);
44 _targetType = targetType;
45 }
46
47 protected MismatchedInputException(JsonParser p, String msg, JavaType targetType) {
48 super(p, msg);
49 _targetType = ClassUtil.rawClass(targetType);
50 }
51
52
53 @Deprecated
54 public static MismatchedInputException from(JsonParser p, String msg) {
55 return from(p, (Class<?>) null, msg);
56 }
57
58 public static MismatchedInputException from(JsonParser p, JavaType targetType, String msg) {
59 return new MismatchedInputException(p, msg, targetType);
60 }
61
62 public static MismatchedInputException from(JsonParser p, Class<?> targetType, String msg) {
63 return new MismatchedInputException(p, msg, targetType);
64 }
65
66 public MismatchedInputException setTargetType(JavaType t) {
67 _targetType = t.getRawClass();
68 return this;
69 }
70
71
72
73
74
75 public Class<?> getTargetType() {
76 return _targetType;
77 }
78 }