Class JSON

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

    @Generated("org.openapitools.codegen.languages.JavaClientCodegen")
    public class JSON
    extends java.lang.Object
    implements javax.ws.rs.ext.ContextResolver<com.fasterxml.jackson.databind.ObjectMapper>
    • Constructor Summary

      Constructors 
      Constructor Description
      JSON()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.Class<?> getClassForElement​(com.fasterxml.jackson.databind.JsonNode node, java.lang.Class<?> modelClass)
      Returns the target model class that should be used to deserialize the input data.
      com.fasterxml.jackson.databind.ObjectMapper getContext​(java.lang.Class<?> type)  
      static JSON getDefault()
      Get the default JSON instance.
      com.fasterxml.jackson.databind.ObjectMapper getMapper()
      Get the object mapper
      static boolean isInstanceOf​(java.lang.Class<?> modelClass, java.lang.Object inst, java.util.Set<java.lang.Class<?>> visitedClasses)
      Returns true if inst is an instance of modelClass in the OpenAPI model hierarchy.
      static void registerDescendants​(java.lang.Class<?> modelClass, java.util.Map<java.lang.String,​javax.ws.rs.core.GenericType> descendants)
      Register the oneOf/anyOf descendants of the modelClass.
      static void registerDiscriminator​(java.lang.Class<?> modelClass, java.lang.String discriminatorPropertyName, java.util.Map<java.lang.String,​java.lang.Class<?>> mappings)
      Register a model class discriminator.
      void setDateFormat​(java.text.DateFormat dateFormat)
      Set the date format for JSON (de)serialization with Date properties.
      static void setDefault​(JSON json)
      Set the default JSON instance.
      • Methods inherited from class java.lang.Object

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

      • JSON

        public JSON()
    • Method Detail

      • 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>
      • getMapper

        public com.fasterxml.jackson.databind.ObjectMapper getMapper()
        Get the object mapper
        Returns:
        object mapper
      • getClassForElement

        public static java.lang.Class<?> getClassForElement​(com.fasterxml.jackson.databind.JsonNode node,
                                                            java.lang.Class<?> modelClass)
        Returns the target model class that should be used to deserialize the input data. The discriminator mappings are used to determine the target model class.
        Parameters:
        node - The input data.
        modelClass - The class that contains the discriminator mappings.
      • isInstanceOf

        public static boolean isInstanceOf​(java.lang.Class<?> modelClass,
                                           java.lang.Object inst,
                                           java.util.Set<java.lang.Class<?>> visitedClasses)
        Returns true if inst is an instance of modelClass in the OpenAPI model hierarchy. The Java class hierarchy is not implemented the same way as the OpenAPI model hierarchy, so it's not possible to use the instanceof keyword.
        Parameters:
        modelClass - A OpenAPI model class.
        inst - The instance object.
      • registerDiscriminator

        public static void registerDiscriminator​(java.lang.Class<?> modelClass,
                                                 java.lang.String discriminatorPropertyName,
                                                 java.util.Map<java.lang.String,​java.lang.Class<?>> mappings)
        Register a model class discriminator.
        Parameters:
        modelClass - the model class
        discriminatorPropertyName - the name of the discriminator property
        mappings - a map with the discriminator mappings.
      • registerDescendants

        public static void registerDescendants​(java.lang.Class<?> modelClass,
                                               java.util.Map<java.lang.String,​javax.ws.rs.core.GenericType> descendants)
        Register the oneOf/anyOf descendants of the modelClass.
        Parameters:
        modelClass - the model class
        descendants - a map of oneOf/anyOf descendants.
      • getDefault

        public static JSON getDefault()
        Get the default JSON instance.
        Returns:
        the default JSON instance
      • setDefault

        public static void setDefault​(JSON json)
        Set the default JSON instance.
        Parameters:
        json - JSON instance to be used