Class PersistentEntityToJsonSchemaConverter
java.lang.Object
org.springframework.data.rest.webmvc.json.PersistentEntityToJsonSchemaConverter
- All Implemented Interfaces:
org.springframework.core.convert.converter.ConditionalConverter
,org.springframework.core.convert.converter.ConditionalGenericConverter
,org.springframework.core.convert.converter.GenericConverter
public class PersistentEntityToJsonSchemaConverter
extends Object
implements org.springframework.core.convert.converter.ConditionalGenericConverter
Converter to create
JsonSchema
instances for PersistentEntity
s.- Author:
- Jon Brisbin, Oliver Gierke, Greg Turnquist
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Nested classes/interfaces inherited from interface org.springframework.core.convert.converter.GenericConverter
org.springframework.core.convert.converter.GenericConverter.ConvertiblePair
-
Constructor Summary
ConstructorDescriptionPersistentEntityToJsonSchemaConverter
(org.springframework.data.mapping.context.PersistentEntities entities, Associations associations, org.springframework.hateoas.mediatype.MessageResolver resolver, com.fasterxml.jackson.databind.ObjectMapper objectMapper, RepositoryRestConfiguration configuration, PersistentEntityToJsonSchemaConverter.ValueTypeSchemaPropertyCustomizerFactory customizerFactory) Creates a newPersistentEntityToJsonSchemaConverter
for the givenPersistentEntities
andResourceMappings
. -
Method Summary
Modifier and TypeMethodDescriptionConverts the given type into aJsonSchema
instance.convert
(Object source, org.springframework.core.convert.TypeDescriptor sourceType, org.springframework.core.convert.TypeDescriptor targetType) Set<org.springframework.core.convert.converter.GenericConverter.ConvertiblePair>
boolean
matches
(org.springframework.core.convert.TypeDescriptor sourceType, org.springframework.core.convert.TypeDescriptor targetType)
-
Constructor Details
-
PersistentEntityToJsonSchemaConverter
public PersistentEntityToJsonSchemaConverter(org.springframework.data.mapping.context.PersistentEntities entities, Associations associations, org.springframework.hateoas.mediatype.MessageResolver resolver, com.fasterxml.jackson.databind.ObjectMapper objectMapper, RepositoryRestConfiguration configuration, PersistentEntityToJsonSchemaConverter.ValueTypeSchemaPropertyCustomizerFactory customizerFactory) Creates a newPersistentEntityToJsonSchemaConverter
for the givenPersistentEntities
andResourceMappings
.- Parameters:
entities
- must not be null.associations
- must not be null.resolver
- must not be null.objectMapper
- must not be null.configuration
- must not be null.customizerFactory
- must not be null.
-
-
Method Details
-
matches
public boolean matches(org.springframework.core.convert.TypeDescriptor sourceType, org.springframework.core.convert.TypeDescriptor targetType) - Specified by:
matches
in interfaceorg.springframework.core.convert.converter.ConditionalConverter
-
getConvertibleTypes
public Set<org.springframework.core.convert.converter.GenericConverter.ConvertiblePair> getConvertibleTypes()- Specified by:
getConvertibleTypes
in interfaceorg.springframework.core.convert.converter.GenericConverter
-
convert
Converts the given type into aJsonSchema
instance.- Parameters:
domainType
- must not be null.- Returns:
-
convert
public JsonSchema convert(Object source, org.springframework.core.convert.TypeDescriptor sourceType, org.springframework.core.convert.TypeDescriptor targetType) - Specified by:
convert
in interfaceorg.springframework.core.convert.converter.GenericConverter
-