Class SecurityJackson2Modules


  • public final class SecurityJackson2Modules
    extends java.lang.Object
    This utility class will find all the SecurityModules in classpath.

         ObjectMapper mapper = new ObjectMapper();
         mapper.registerModules(SecurityJackson2Modules.getModules());
     
    Above code is equivalent to

         ObjectMapper mapper = new ObjectMapper();
         mapper.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL, JsonTypeInfo.As.PROPERTY);
         mapper.registerModule(new CoreJackson2Module());
         mapper.registerModule(new CasJackson2Module());
         mapper.registerModule(new WebJackson2Module());
         mapper.registerModule(new WebServletJackson2Module());
         mapper.registerModule(new WebServerJackson2Module());
         mapper.registerModule(new OAuth2ClientJackson2Module());
     
    Since:
    4.2
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void enableDefaultTyping​(com.fasterxml.jackson.databind.ObjectMapper mapper)  
      static java.util.List<com.fasterxml.jackson.databind.Module> getModules​(java.lang.ClassLoader loader)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • enableDefaultTyping

        public static void enableDefaultTyping​(com.fasterxml.jackson.databind.ObjectMapper mapper)
      • getModules

        public static java.util.List<com.fasterxml.jackson.databind.Module> getModules​(java.lang.ClassLoader loader)
        Parameters:
        loader - the ClassLoader to use
        Returns:
        List of available security modules in classpath.