Java Code Examples for org.modelmapper.ModelMapper#addConverter()

The following examples show how to use org.modelmapper.ModelMapper#addConverter() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DemoSecurityApp.java    From sbp with Apache License 2.0 5 votes vote down vote up
@Bean
@ConditionalOnMissingBean
public ModelMapper modelMapper() {
    ModelMapper mapper = new ModelMapper();
    mapper.getConfiguration().setSourceNameTokenizer(NameTokenizers.CAMEL_CASE)
            .addValueReader(new RecordValueReader());
    mapper.addConverter(new IdsConverter());
    return mapper;
}
 
Example 2
Source File: DemoApp.java    From sbp with Apache License 2.0 5 votes vote down vote up
@Bean
@ConditionalOnMissingBean
@DependsOn("multiApplicationContextProviderRegister")
public ModelMapper modelMapper(ApplicationContext applicationContext) {
    ModelMapper mapper = new ModelMapper();
    mapper.getConfiguration().setSourceNameTokenizer(NameTokenizers.CAMEL_CASE)
            .addValueReader(new RecordValueReader());
    mapper.addConverter(new IdsConverter());
    return mapper;
}
 
Example 3
Source File: LibraryPluginStarter.java    From sbp with Apache License 2.0 5 votes vote down vote up
@Bean
public ModelMapper modelMapper() {
    ModelMapper mapper = new ModelMapper();
    mapper.getConfiguration().setSourceNameTokenizer(NameTokenizers.CAMEL_CASE)
            .addValueReader(new RecordValueReader());
    mapper.addConverter(new IdsConverter());
    return mapper;
}
 
Example 4
Source File: AuthorPluginStarter.java    From sbp with Apache License 2.0 5 votes vote down vote up
@Bean
public ModelMapper modelMapper() {
    ModelMapper mapper = new ModelMapper();
    mapper.getConfiguration().setSourceNameTokenizer(NameTokenizers.CAMEL_CASE)
            .addValueReader(new RecordValueReader());
    mapper.addConverter(new IdsConverter());
    return mapper;
}
 
Example 5
Source File: ShelfPluginStarter.java    From sbp with Apache License 2.0 5 votes vote down vote up
@Bean
public ModelMapper modelMapper() {
    ModelMapper mapper = new ModelMapper();
    mapper.getConfiguration().setSourceNameTokenizer(NameTokenizers.CAMEL_CASE)
            .addValueReader(new RecordValueReader());
    mapper.addConverter(new IdsConverter());
    return mapper;
}
 
Example 6
Source File: ModelMapperAutoConfiguration.java    From building-microservices with Apache License 2.0 5 votes vote down vote up
private void addConverters(ModelMapper modelMapper) {
	if (this.properties.isAddConverters() && this.converters != null) {
		for (Converter<?, ?> converter : this.converters) {
			modelMapper.addConverter(converter);
		}
	}
}
 
Example 7
Source File: ConverterConfigurerSupport.java    From modelmapper-spring-boot-starter with Apache License 2.0 2 votes vote down vote up
/**
 * Configures the passed {@link ModelMapper} instance by registering the {@link Converter} defined by
 * {@link #converter()} method.
 *
 * @param modelMapper {@link ModelMapper} instance to be configured
 */
@Override
public void configure(ModelMapper modelMapper) {

    modelMapper.addConverter(converter());
}