-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #1017 (add InvalidTypeIdException)
- Loading branch information
1 parent
2d318f6
commit 1ecc6b5
Showing
4 changed files
with
100 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
src/main/java/com/fasterxml/jackson/databind/exc/InvalidTypeIdException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package com.fasterxml.jackson.databind.exc; | ||
|
||
import com.fasterxml.jackson.core.JsonParser; | ||
import com.fasterxml.jackson.databind.JavaType; | ||
import com.fasterxml.jackson.databind.JsonMappingException; | ||
|
||
/** | ||
* Exception thrown when resolution of a type id fails. | ||
* | ||
* @since 2.8 | ||
*/ | ||
public class InvalidTypeIdException extends JsonMappingException | ||
{ | ||
private static final long serialVersionUID = 1L; // silly Eclipse, warnings | ||
|
||
/** | ||
* Basetype for which subtype was to be resolved | ||
*/ | ||
protected final JavaType _baseType; | ||
|
||
/** | ||
* Type id that failed to be resolved to a subtype | ||
*/ | ||
protected final String _typeId; | ||
|
||
/* | ||
/********************************************************** | ||
/* Life-cycle | ||
/********************************************************** | ||
*/ | ||
|
||
public InvalidTypeIdException(JsonParser p, String msg, | ||
JavaType baseType, String typeId) | ||
{ | ||
super(p, msg); | ||
_baseType = baseType; | ||
_typeId = typeId; | ||
} | ||
|
||
public static InvalidTypeIdException from(JsonParser p, String msg, | ||
JavaType baseType, String typeId) { | ||
return new InvalidTypeIdException(p, msg, baseType, typeId); | ||
} | ||
|
||
/* | ||
/********************************************************** | ||
/* Accessors | ||
/********************************************************** | ||
*/ | ||
|
||
public JavaType getBaseType() { return _baseType; } | ||
public String getTypeId() { return _typeId; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters