I have the following abstract class structure:
public abstract class A {
...
private List<B> b;
public List<B> getB() {
return b;
}
public void setB(List<B> b) {
this.b = b;
}
public static abstract class B {
}
}
and implement it as follows:
public class AA extends A {
public static class BB extends B {
...
}
When I now use jackson to display Json on AA, I get an error that it cannot create an instance of A $ B. I think this is because the getter / setter in still refers to B and not to BB, which causes an error. Is there a way I can do this without adding a getter / setter to a subclass?
source
share