Example usage for org.springframework.data.rest.webmvc.json PersistentEntityToJsonSchemaConverter PersistentEntityToJsonSchemaConverter

List of usage examples for org.springframework.data.rest.webmvc.json PersistentEntityToJsonSchemaConverter PersistentEntityToJsonSchemaConverter

Introduction

In this page you can find the example usage for org.springframework.data.rest.webmvc.json PersistentEntityToJsonSchemaConverter PersistentEntityToJsonSchemaConverter.

Prototype

public PersistentEntityToJsonSchemaConverter(PersistentEntities entities, Associations associations,
        MessageResolver resolver, ObjectMapper objectMapper, RepositoryRestConfiguration configuration,
        ValueTypeSchemaPropertyCustomizerFactory customizerFactory) 

Source Link

Document

Creates a new PersistentEntityToJsonSchemaConverter for the given PersistentEntities and ResourceMappings .

Usage

From source file:org.springframework.data.rest.webmvc.json.PersistentEntityToJsonSchemaConverterUnitTests.java

@Before
public void setUp() {

    TestMvcClient.initWebTest();//  www.j  a  v a 2 s  .  c  o m

    ValueTypeSchemaPropertyCustomizerFactory customizerFactory = mock(
            ValueTypeSchemaPropertyCustomizerFactory.class);

    converter = new PersistentEntityToJsonSchemaConverter(entities, associations, accessor, objectMapper,
            configuration, customizerFactory);
}

From source file:org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration.java

/**
 * Turns a domain class into a {@link org.springframework.data.rest.webmvc.json.JsonSchema}.
 * //ww  w. ja  va 2  s  .  co m
 * @return
 */
@Bean
public PersistentEntityToJsonSchemaConverter jsonSchemaConverter() {

    return new PersistentEntityToJsonSchemaConverter(persistentEntities(), associationLinks(),
            resourceDescriptionMessageSourceAccessor(), objectMapper(), config(),
            new ValueTypeSchemaPropertyCustomizerFactory(repositoryInvokerFactory(defaultConversionService())));
}