Package org.oxerr.jackson.module.jsr250


package org.oxerr.jackson.module.jsr250
Excludes properties from serialization output. Supports:
  • DenyAll
  • RolesAllowed
For example:
 public class User {

     private String nickname;

     private String username;

     private String password;

     public String getNickname() {
         return nickname;
     }

     @RolesAllowed("ROLE_ADMIN")
     public String getUsername() {
         return username;
     }

     @DenyAll
     public String getPassword() {
         return password;
     }

 }
 
The username will be excluded if currently authenticated principal is not in ADMIN role, and the password will be always excluded.