Class JSON

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

    public class JSON
    extends Object
    implements jakarta.ws.rs.ext.ContextResolver<com.fasterxml.jackson.databind.ObjectMapper>
    JSON Class.
    • 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​(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​(Class<?> type)
        Specified by:
        getContext in interface jakarta.ws.rs.ext.ContextResolver<com.fasterxml.jackson.databind.ObjectMapper>