Modify jackson exception
This commit is contained in:
parent
9163f109d3
commit
415e6ea607
|
@ -2,12 +2,15 @@ package org.baeldung.jackson.exception;
|
||||||
|
|
||||||
public class Zoo {
|
public class Zoo {
|
||||||
public Animal animal;
|
public Animal animal;
|
||||||
|
|
||||||
|
public Zoo() {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract class Animal {
|
abstract class Animal {
|
||||||
public String name;
|
public String name;
|
||||||
|
|
||||||
protected Animal() {
|
public Animal() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,13 +4,16 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||||
|
|
||||||
public class ZooConfigured {
|
public class ZooConfigured {
|
||||||
public AnimalConfigured animal;
|
public AnimalConfigured animal;
|
||||||
|
|
||||||
|
public ZooConfigured() {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@JsonDeserialize(as = CatConfigured.class)
|
@JsonDeserialize(as = CatConfigured.class)
|
||||||
abstract class AnimalConfigured {
|
abstract class AnimalConfigured {
|
||||||
public String name;
|
public String name;
|
||||||
|
|
||||||
protected AnimalConfigured() {
|
public AnimalConfigured() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue