Class JSON

  • All Implemented Interfaces:
    javax.ws.rs.ext.ContextResolver<com.fasterxml.jackson.databind.ObjectMapper>

    public class JSON
    extends java.lang.Object
    implements javax.ws.rs.ext.ContextResolver<com.fasterxml.jackson.databind.ObjectMapper>
    JSON Class.
    • Constructor Summary

      Constructors 
      Constructor Description
      JSON()
      JSON Class constructor doc.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.fasterxml.jackson.databind.ObjectMapper getContext​(java.lang.Class<?> type)  
      com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
      Returns the current object mapper used for JSON serialization/deserialization.
      void setDateFormat​(java.text.DateFormat dateFormat)
      Set the date format for JSON (de)serialization with Date properties.
      JSON setObjectMapper​(com.fasterxml.jackson.databind.ObjectMapper mapper)  
      • Methods inherited from class java.lang.Object

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

      • JSON

        public JSON()
        JSON Class constructor doc.
    • Method Detail

      • getObjectMapper

        public com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
        Returns the current object mapper used for JSON serialization/deserialization.

        Note: If you make changes to the object mapper, remember to set it back via setObjectMapper in order to trigger HTTP client rebuilding.

        Returns:
        Object mapper
      • setObjectMapper

        public JSON setObjectMapper​(com.fasterxml.jackson.databind.ObjectMapper mapper)
      • setDateFormat

        public void setDateFormat​(java.text.DateFormat dateFormat)
        Set the date format for JSON (de)serialization with Date properties.
        Parameters:
        dateFormat - Date format
      • getContext

        public com.fasterxml.jackson.databind.ObjectMapper getContext​(java.lang.Class<?> type)
        Specified by:
        getContext in interface javax.ws.rs.ext.ContextResolver<com.fasterxml.jackson.databind.ObjectMapper>