Hey, there.
I'm facing a huge problem here at my environment, I need get at runtime my
Object's name for example:
Class A {
private String bar;
}
A foo = new A();
At runtime I need exclude the field "bar" on my instance "foo" during the
serialitazion without using @JsonIgnore on my class;
I'm trying the follow code by it doesn't work because I can't access the
Object's name
mapper.setAnnotationIntrospector(new JacksonAnnotationIntrospector(){
@Override
protected boolean _isIgnorable(Annotated a) {
if(a.getName().contains("b")) {
return true;
}
boolean isIgnorable = super._isIgnorable(a);
return isIgnorable;
}
});
is there any way that I could do that?
--
You received this message because you are subscribed to the Google Groups
"jackson-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jackson-user/a9b7a977-59c8-4fa9-a1ee-7682c375026f%40googlegroups.com.