@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen", date="2024-02-12T14:43:58.169865-05:00[America/New_York]") public class JSON extends Object implements ContextResolver<ObjectMapper>
Constructor and Description |
---|
JSON() |
Modifier and Type | Method and Description |
---|---|
static Class<?> |
getClassForElement(JsonNode node,
Class<?> modelClass)
Returns the target model class that should be used to deserialize the input data.
|
ObjectMapper |
getContext(Class<?> type) |
static JSON |
getDefault()
Get the default JSON instance.
|
ObjectMapper |
getMapper()
Get the object mapper
|
static boolean |
isInstanceOf(Class<?> modelClass,
Object inst,
Set<Class<?>> visitedClasses)
Returns true if inst is an instance of modelClass in the OpenAPI model hierarchy.
|
static void |
registerDescendants(Class<?> modelClass,
Map<String,GenericType> descendants)
Register the oneOf/anyOf descendants of the modelClass.
|
static void |
registerDiscriminator(Class<?> modelClass,
String discriminatorPropertyName,
Map<String,Class<?>> mappings)
Register a model class discriminator.
|
void |
setDateFormat(DateFormat dateFormat)
Set the date format for JSON (de)serialization with Date properties.
|
static void |
setDefault(JSON json)
Set the default JSON instance.
|
public void setDateFormat(DateFormat dateFormat)
dateFormat
- Date formatpublic ObjectMapper getContext(Class<?> type)
getContext
in interface ContextResolver<ObjectMapper>
public ObjectMapper getMapper()
public static Class<?> getClassForElement(JsonNode node, Class<?> modelClass)
node
- The input data.modelClass
- The class that contains the discriminator mappings.public static boolean isInstanceOf(Class<?> modelClass, Object inst, Set<Class<?>> visitedClasses)
modelClass
- A OpenAPI model class.inst
- The instance object.public static void registerDiscriminator(Class<?> modelClass, String discriminatorPropertyName, Map<String,Class<?>> mappings)
modelClass
- the model classdiscriminatorPropertyName
- the name of the discriminator propertymappings
- a map with the discriminator mappings.public static void registerDescendants(Class<?> modelClass, Map<String,GenericType> descendants)
modelClass
- the model classdescendants
- a map of oneOf/anyOf descendants.public static JSON getDefault()
public static void setDefault(JSON json)
json
- JSON instance to be used