On Wed, Feb 19, 2020 at 1:44 PM Victor Costa
<victor.co...@grupoequatorial.com.br> wrote:
>
> Hey, There.
>
> I'd like to know if there a way to choose the fields into an object to be 
> ignored at runtime without using @JsonIgnore anotation on my Model I'm doing 
> the follow code:
>
>
> mapper.setAnnotationIntrospector(new JacksonAnnotationIntrospector() {
>      @Override
>      protected boolean _isIgnorable(Annotated a) {
>         if( a.getName().contains("foo")) {
>          return true;
>          }
>      };
> });
>
> is there any way to do that?

There are multiple mechanisms for filtering out properties to write
(serialize), see f.ex:

http://www.cowtowncoder.com/blog/archives/2011/02/entry_443.html

in particular "JSON View"s (annotated sets of fields to include) and
"JSON Filter".

-+ Tatu +-

-- 
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 jackson-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jackson-user/CAL4a10gRLTRr46D1P8-G2tFfWMfFghCSW1v_BgpZ6GyrzJyVEQ%40mail.gmail.com.

Reply via email to