I have following interface.
interface MyInterface {
public String getJsonString()
}
There is an implementation of this interface. getJsonString returns a string(json) representation of (some) ABC class.
I want to introduce custom annotation @JsonToObject as following:
interface MyInterface {
@JsonToObject(ABC.class)
public String getMyString()
}
@JsonToObject Annotation should converts returned String to ABC class object using Jackson. And returns the ABC class object. If not possible just throw exception.
Basically, convert the returned string to given class object.
Is this possible?
I am using Spring for DI.
Thanks in advance.