private void initializeConverters() { customConversions.registerConvertersIn(conversionService); }
/** * Registers additional converters that will be available when using the {@link ConversionService} directly (e.g. for * id conversion). These converters are not custom conversions as they'd introduce unwanted conversions (e.g. * ObjectId-to-String). */ private void initializeConverters() { conversionService.addConverter(ObjectIdToStringConverter.INSTANCE); conversionService.addConverter(StringToObjectIdConverter.INSTANCE); if (!conversionService.canConvert(ObjectId.class, BigInteger.class)) { conversionService.addConverter(ObjectIdToBigIntegerConverter.INSTANCE); } if (!conversionService.canConvert(BigInteger.class, ObjectId.class)) { conversionService.addConverter(BigIntegerToObjectIdConverter.INSTANCE); } conversions.registerConvertersIn(conversionService); }
/** * Registers additional converters that will be available when using the {@link ConversionService} directly (e.g. for * id conversion). These converters are not custom conversions as they'd introduce unwanted conversions (e.g. * ObjectId-to-String). */ private void initializeConverters() { conversionService.addConverter(ObjectIdToStringConverter.INSTANCE); conversionService.addConverter(StringToObjectIdConverter.INSTANCE); if (!conversionService.canConvert(ObjectId.class, BigInteger.class)) { conversionService.addConverter(ObjectIdToBigIntegerConverter.INSTANCE); } if (!conversionService.canConvert(BigInteger.class, ObjectId.class)) { conversionService.addConverter(BigIntegerToObjectIdConverter.INSTANCE); } conversions.registerConvertersIn(conversionService); }
/** * register {@link #customConversions} with {@link #conversionService} * * @param conversionService */ protected void registerCustomConverters(GenericConversionService conversionService) { if (customConversions != null) { customConversions.registerConvertersIn(conversionService); } }
/** * Do nothing after the properties set on the bean. */ @Override public void afterPropertiesSet() { conversions.registerConvertersIn(conversionService); }
/** * Registers additional converters that will be available when using the * {@link ConversionService} directly (e.g. for id conversion). */ private void initializeConverters() { conversions.registerConvertersIn(conversionService); } }
/** * Do nothing after the properties set on the bean. */ @Override public void afterPropertiesSet() { conversions.registerConvertersIn(conversionService); }
private void initializeConverters() { customConversions.registerConvertersIn(conversionService); }
private void initializeConverters() { customConversions.registerConvertersIn(conversionService); }
@SuppressWarnings("unchecked") private BasicRelationalConverter( MappingContext<? extends RelationalPersistentEntity<?>, ? extends RelationalPersistentProperty> context, CustomConversions conversions, ConfigurableConversionService conversionService, EntityInstantiators entityInstantiators) { Assert.notNull(context, "MappingContext must not be null!"); Assert.notNull(conversions, "CustomConversions must not be null!"); this.context = (MappingContext) context; this.conversionService = conversionService; this.entityInstantiators = entityInstantiators; this.conversions = conversions; conversions.registerConvertersIn(this.conversionService); }
@SuppressWarnings("unchecked") private BasicRelationalConverter( MappingContext<? extends RelationalPersistentEntity<?>, ? extends RelationalPersistentProperty> context, CustomConversions conversions, ConfigurableConversionService conversionService, EntityInstantiators entityInstantiators) { Assert.notNull(context, "MappingContext must not be null!"); Assert.notNull(conversions, "CustomConversions must not be null!"); this.context = (MappingContext) context; this.conversionService = conversionService; this.entityInstantiators = entityInstantiators; this.conversions = conversions; conversions.registerConvertersIn(this.conversionService); }
@SuppressWarnings("unchecked") private BasicRelationalConverter( MappingContext<? extends RelationalPersistentEntity<?>, ? extends RelationalPersistentProperty> context, CustomConversions conversions, ConfigurableConversionService conversionService, EntityInstantiators entityInstantiators) { Assert.notNull(context, "MappingContext must not be null!"); Assert.notNull(conversions, "CustomConversions must not be null!"); this.context = (MappingContext) context; this.conversionService = conversionService; this.entityInstantiators = entityInstantiators; this.conversions = conversions; conversions.registerConvertersIn(this.conversionService); }
/** * Constructor. * @param customConversions must not be null. * @param conversionService if null, then {@link DefaultConversionService} is used. */ SpannerCustomConverter(CustomConversions customConversions, GenericConversionService conversionService) { Assert.notNull(customConversions, "Valid custom conversions are required!"); this.conversionService = (conversionService != null) ? conversionService : new DefaultConversionService(); customConversions.registerConvertersIn(this.conversionService); }
/** * Constructor. * @param customConversions must not be null. * @param conversionService if null, then {@link DefaultConversionService} is used. */ SpannerCustomConverter(CustomConversions customConversions, GenericConversionService conversionService) { Assert.notNull(customConversions, "Valid custom conversions are required!"); this.conversionService = (conversionService != null) ? conversionService : new DefaultConversionService(); customConversions.registerConvertersIn(this.conversionService); }
/** * Registers additional converters that will be available when using the {@link ConversionService} directly (e.g. for * id conversion). These converters are not custom conversions as they'd introduce unwanted conversions. */ private void initializeConverters() { ConversionService conversionService = getConversionService(); if (conversionService instanceof GenericConversionService) { getCustomConversions().registerConvertersIn((GenericConversionService) conversionService); } } }
public DefaultArangoConverter( final MappingContext<? extends ArangoPersistentEntity<?>, ArangoPersistentProperty> context, final CustomConversions conversions, final ResolverFactory resolverFactory, final ArangoTypeMapper typeMapper) { this.context = context; this.conversions = conversions; this.resolverFactory = resolverFactory; this.typeMapper = typeMapper; conversionService = new DefaultConversionService(); conversions.registerConvertersIn(conversionService); instantiators = new EntityInstantiators(); }
public DefaultArangoConverter( final MappingContext<? extends ArangoPersistentEntity<?>, ArangoPersistentProperty> context, final CustomConversions conversions, final ResolverFactory resolverFactory, final ArangoTypeMapper typeMapper) { this.context = context; this.conversions = conversions; this.resolverFactory = resolverFactory; this.typeMapper = typeMapper; conversionService = new DefaultConversionService(); conversions.registerConvertersIn(conversionService); instantiators = new EntityInstantiators(); }
public TwoStepsConversions(CustomConversions customConversions, ObjectToKeyFactory objectToKeyFactory) { this.objectToKeyFactory = objectToKeyFactory; this.conversionService = new DefaultConversionService(); this.internalConversionService = new DefaultConversionService(); this.customConversions = customConversions; this.customConversions.registerConvertersIn(this.conversionService); this.internalConversionService.addConverter(BYTE_ARRAY_TO_BLOB_CONVERTER); this.internalConversionService.addConverter(BLOB_TO_BYTE_ARRAY_CONVERTER); }
public TwoStepsConversions(CustomConversions customConversions, ObjectToKeyFactory objectToKeyFactory) { this.objectToKeyFactory = objectToKeyFactory; this.conversionService = new DefaultConversionService(); this.internalConversionService = new DefaultConversionService(); this.customConversions = customConversions; this.customConversions.registerConvertersIn(this.conversionService); this.internalConversionService.addConverter(BYTE_ARRAY_TO_BLOB_CONVERTER); this.internalConversionService.addConverter(BLOB_TO_BYTE_ARRAY_CONVERTER); }