congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
ConfigurableBeanFactory.getConversionService
Code IndexAdd Tabnine to your IDE (free)

How to use
getConversionService
method
in
org.springframework.beans.factory.config.ConfigurableBeanFactory

Best Java code snippets using org.springframework.beans.factory.config.ConfigurableBeanFactory.getConversionService (Showing top 20 results out of 315)

origin: spring-projects/spring-framework

@Override
public void copyConfigurationFrom(ConfigurableBeanFactory otherFactory) {
  Assert.notNull(otherFactory, "BeanFactory must not be null");
  setBeanClassLoader(otherFactory.getBeanClassLoader());
  setCacheBeanMetadata(otherFactory.isCacheBeanMetadata());
  setBeanExpressionResolver(otherFactory.getBeanExpressionResolver());
  setConversionService(otherFactory.getConversionService());
  if (otherFactory instanceof AbstractBeanFactory) {
    AbstractBeanFactory otherAbstractFactory = (AbstractBeanFactory) otherFactory;
    this.propertyEditorRegistrars.addAll(otherAbstractFactory.propertyEditorRegistrars);
    this.customEditors.putAll(otherAbstractFactory.customEditors);
    this.typeConverter = otherAbstractFactory.typeConverter;
    this.beanPostProcessors.addAll(otherAbstractFactory.beanPostProcessors);
    this.hasInstantiationAwareBeanPostProcessors = this.hasInstantiationAwareBeanPostProcessors ||
        otherAbstractFactory.hasInstantiationAwareBeanPostProcessors;
    this.hasDestructionAwareBeanPostProcessors = this.hasDestructionAwareBeanPostProcessors ||
        otherAbstractFactory.hasDestructionAwareBeanPostProcessors;
    this.scopes.putAll(otherAbstractFactory.scopes);
    this.securityContextProvider = otherAbstractFactory.securityContextProvider;
  }
  else {
    setTypeConverter(otherFactory.getTypeConverter());
    String[] otherScopeNames = otherFactory.getRegisteredScopeNames();
    for (String scopeName : otherScopeNames) {
      this.scopes.put(scopeName, otherFactory.getRegisteredScope(scopeName));
    }
  }
}
origin: spring-projects/spring-data-redis

public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
  // TODO: This code can never happen...
  if (converter == null && beanFactory instanceof ConfigurableBeanFactory) {
    ConfigurableBeanFactory cFB = (ConfigurableBeanFactory) beanFactory;
    ConversionService conversionService = cFB.getConversionService();
    converter = (conversionService != null ? new Converter(conversionService)
        : new Converter(cFB.getTypeConverter()));
  }
}
origin: spring-projects/spring-framework

sec.setBeanResolver(new BeanFactoryResolver(evalContext.getBeanFactory()));
sec.setTypeLocator(new StandardTypeLocator(evalContext.getBeanFactory().getBeanClassLoader()));
ConversionService conversionService = evalContext.getBeanFactory().getConversionService();
if (conversionService != null) {
  sec.setTypeConverter(new StandardTypeConverter(conversionService));
origin: org.springframework/spring-beans

@Override
public void copyConfigurationFrom(ConfigurableBeanFactory otherFactory) {
  Assert.notNull(otherFactory, "BeanFactory must not be null");
  setBeanClassLoader(otherFactory.getBeanClassLoader());
  setCacheBeanMetadata(otherFactory.isCacheBeanMetadata());
  setBeanExpressionResolver(otherFactory.getBeanExpressionResolver());
  setConversionService(otherFactory.getConversionService());
  if (otherFactory instanceof AbstractBeanFactory) {
    AbstractBeanFactory otherAbstractFactory = (AbstractBeanFactory) otherFactory;
    this.propertyEditorRegistrars.addAll(otherAbstractFactory.propertyEditorRegistrars);
    this.customEditors.putAll(otherAbstractFactory.customEditors);
    this.typeConverter = otherAbstractFactory.typeConverter;
    this.beanPostProcessors.addAll(otherAbstractFactory.beanPostProcessors);
    this.hasInstantiationAwareBeanPostProcessors = this.hasInstantiationAwareBeanPostProcessors ||
        otherAbstractFactory.hasInstantiationAwareBeanPostProcessors;
    this.hasDestructionAwareBeanPostProcessors = this.hasDestructionAwareBeanPostProcessors ||
        otherAbstractFactory.hasDestructionAwareBeanPostProcessors;
    this.scopes.putAll(otherAbstractFactory.scopes);
    this.securityContextProvider = otherAbstractFactory.securityContextProvider;
  }
  else {
    setTypeConverter(otherFactory.getTypeConverter());
    String[] otherScopeNames = otherFactory.getRegisteredScopeNames();
    for (String scopeName : otherScopeNames) {
      this.scopes.put(scopeName, otherFactory.getRegisteredScope(scopeName));
    }
  }
}
origin: org.springframework/spring-context

sec.setBeanResolver(new BeanFactoryResolver(evalContext.getBeanFactory()));
sec.setTypeLocator(new StandardTypeLocator(evalContext.getBeanFactory().getBeanClassLoader()));
ConversionService conversionService = evalContext.getBeanFactory().getConversionService();
if (conversionService != null) {
  sec.setTypeConverter(new StandardTypeConverter(conversionService));
origin: ryantenney/metrics-spring

@Override
public void setBeanFactory(final BeanFactory beanFactory) {
  this.beanFactory = beanFactory;
  if (beanFactory instanceof ConfigurableBeanFactory) {
    this.conversionService = ((ConfigurableBeanFactory) beanFactory).getConversionService();
  }
}
origin: org.springframework.data/spring-data-geode

/**
 * Resolves the configured {@link ConversionService} from the {@link BeanFactory}.
 *
 * @return an {@link Optional optionally} configured {@link ConversionService}.
 * @see org.springframework.core.convert.ConversionService
 * @see java.util.Optional
 * @see #getBeanFactory()
 */
protected Optional<ConversionService> resolveConversionService() {
  return Optional.of(getBeanFactory())
    .filter(it -> it instanceof ConfigurableBeanFactory)
    .map(it -> ((ConfigurableBeanFactory) it).getConversionService());
}
origin: org.springframework.data/spring-data-gemfire

/**
 * Resolves the configured {@link ConversionService} from the {@link BeanFactory}.
 *
 * @return an {@link Optional optionally} configured {@link ConversionService}.
 * @see org.springframework.core.convert.ConversionService
 * @see java.util.Optional
 * @see #getBeanFactory()
 */
protected Optional<ConversionService> resolveConversionService() {
  return Optional.of(getBeanFactory())
    .filter(it -> it instanceof ConfigurableBeanFactory)
    .map(it -> ((ConfigurableBeanFactory) it).getConversionService());
}
origin: org.springframework.data/spring-data-geode

private void configureTypeConverter(EvaluationContext evaluationContext, BeanFactory beanFactory) {
  Optional.ofNullable(evaluationContext)
    .filter(evalContext -> evalContext instanceof StandardEvaluationContext)
    .ifPresent(evalContext ->
      Optional.ofNullable(beanFactory)
        .filter(it -> it instanceof ConfigurableBeanFactory)
        .map(it -> ((ConfigurableBeanFactory) it).getConversionService())
        .ifPresent(conversionService ->
          ((StandardEvaluationContext) evalContext).setTypeConverter(
            new StandardTypeConverter(conversionService)))
    );
}
origin: org.springframework.data/spring-data-gemfire

private void configureTypeConverter(EvaluationContext evaluationContext, BeanFactory beanFactory) {
  Optional.ofNullable(evaluationContext)
    .filter(evalContext -> evalContext instanceof StandardEvaluationContext)
    .ifPresent(evalContext ->
      Optional.ofNullable(beanFactory)
        .filter(it -> it instanceof ConfigurableBeanFactory)
        .map(it -> ((ConfigurableBeanFactory) it).getConversionService())
        .ifPresent(conversionService ->
          ((StandardEvaluationContext) evalContext).setTypeConverter(
            new StandardTypeConverter(conversionService)))
    );
}
origin: org.springframework.data/spring-data-redis

public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
  // TODO: This code can never happen...
  if (converter == null && beanFactory instanceof ConfigurableBeanFactory) {
    ConfigurableBeanFactory cFB = (ConfigurableBeanFactory) beanFactory;
    ConversionService conversionService = cFB.getConversionService();
    converter = (conversionService != null ? new Converter(conversionService)
        : new Converter(cFB.getTypeConverter()));
  }
}
origin: org.eclipse.gemini.blueprint/gemini-blueprint-core

  private TypeConverter getConverter() {
    if (typeConverter == null) {
      SimpleTypeConverter simpleConverter = new SimpleTypeConverter();
      beanFactory.copyRegisteredEditorsTo(simpleConverter);
      simpleConverter.setConversionService(beanFactory.getConversionService());
      typeConverter = simpleConverter;
    }
    return typeConverter;
  }
}
origin: apache/servicemix-bundles

public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
  // TODO: This code can never happen...
  if (converter == null && beanFactory instanceof ConfigurableBeanFactory) {
    ConfigurableBeanFactory cFB = (ConfigurableBeanFactory) beanFactory;
    ConversionService conversionService = cFB.getConversionService();
    converter = (conversionService != null ? new Converter(conversionService)
        : new Converter(cFB.getTypeConverter()));
  }
}
origin: org.springframework.data/spring-data-gemfire

/**
 * {@inheritDoc}
 */
@Override
public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
  super.setBeanFactory(beanFactory);
  this.evaluationContext.setBeanResolver(new BeanFactoryResolver(beanFactory));
  if (beanFactory instanceof ConfigurableBeanFactory) {
    ConfigurableBeanFactory configurableBeanFactory = (ConfigurableBeanFactory) beanFactory;
    this.evaluationContext.setTypeLocator(new StandardTypeLocator(configurableBeanFactory.getBeanClassLoader()));
    Optional.ofNullable(configurableBeanFactory.getConversionService())
      .ifPresent(conversionService ->
        this.evaluationContext.setTypeConverter(new StandardTypeConverter(conversionService)));
  }
}
origin: org.springframework.data/spring-data-geode

/**
 * {@inheritDoc}
 */
@Override
public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
  super.setBeanFactory(beanFactory);
  this.evaluationContext.setBeanResolver(new BeanFactoryResolver(beanFactory));
  if (beanFactory instanceof ConfigurableBeanFactory) {
    ConfigurableBeanFactory configurableBeanFactory = (ConfigurableBeanFactory) beanFactory;
    this.evaluationContext.setTypeLocator(new StandardTypeLocator(configurableBeanFactory.getBeanClassLoader()));
    Optional.ofNullable(configurableBeanFactory.getConversionService())
      .ifPresent(conversionService ->
        this.evaluationContext.setTypeConverter(new StandardTypeConverter(conversionService)));
  }
}
origin: apache/servicemix-bundles

sec.setBeanResolver(new BeanFactoryResolver(evalContext.getBeanFactory()));
sec.setTypeLocator(new StandardTypeLocator(evalContext.getBeanFactory().getBeanClassLoader()));
ConversionService conversionService = evalContext.getBeanFactory().getConversionService();
if (conversionService != null) {
  sec.setTypeConverter(new StandardTypeConverter(conversionService));
origin: org.springframework.data/spring-data-geode

/**
 * Initializes the Spring Expression Language (SpEL) {@link EvaluationContext} used to parse property placeholder
 * and SpEL expressions in the Expiration annotation attribute values.
 */
protected void initEvaluationContext() {
  BeanFactory beanFactory = getBeanFactory();
  if (EVALUATION_CONTEXT_REFERENCE.compareAndSet(null, newEvaluationContext())) {
    StandardEvaluationContext evaluationContext = EVALUATION_CONTEXT_REFERENCE.get();
    evaluationContext.addPropertyAccessor(new BeanFactoryAccessor());
    evaluationContext.addPropertyAccessor(new EnvironmentAccessor());
    evaluationContext.addPropertyAccessor(new MapAccessor());
    if (beanFactory instanceof ConfigurableBeanFactory) {
      ConfigurableBeanFactory configurableBeanFactory = (ConfigurableBeanFactory) beanFactory;
      ConversionService conversionService = configurableBeanFactory.getConversionService();
      if (conversionService != null) {
        evaluationContext.setTypeConverter(new StandardTypeConverter(conversionService));
      }
      evaluationContext.setTypeLocator(new StandardTypeLocator(configurableBeanFactory.getBeanClassLoader()));
    }
  }
  EVALUATION_CONTEXT_REFERENCE.get().setBeanResolver(new BeanFactoryResolver(beanFactory));
}
origin: org.springframework.data/spring-data-gemfire

/**
 * Initializes the Spring Expression Language (SpEL) {@link EvaluationContext} used to parse property placeholder
 * and SpEL expressions in the Expiration annotation attribute values.
 */
protected void initEvaluationContext() {
  BeanFactory beanFactory = getBeanFactory();
  if (EVALUATION_CONTEXT_REFERENCE.compareAndSet(null, newEvaluationContext())) {
    StandardEvaluationContext evaluationContext = EVALUATION_CONTEXT_REFERENCE.get();
    evaluationContext.addPropertyAccessor(new BeanFactoryAccessor());
    evaluationContext.addPropertyAccessor(new EnvironmentAccessor());
    evaluationContext.addPropertyAccessor(new MapAccessor());
    if (beanFactory instanceof ConfigurableBeanFactory) {
      ConfigurableBeanFactory configurableBeanFactory = (ConfigurableBeanFactory) beanFactory;
      ConversionService conversionService = configurableBeanFactory.getConversionService();
      if (conversionService != null) {
        evaluationContext.setTypeConverter(new StandardTypeConverter(conversionService));
      }
      evaluationContext.setTypeLocator(new StandardTypeLocator(configurableBeanFactory.getBeanClassLoader()));
    }
  }
  EVALUATION_CONTEXT_REFERENCE.get().setBeanResolver(new BeanFactoryResolver(beanFactory));
}
origin: org.craftercms/crafter-core

@PostConstruct
public void init() {
  if (evalContext == null) {
    evalContext = new StandardEvaluationContext();
  }
  if (evalContext instanceof StandardEvaluationContext) {
    StandardEvaluationContext standardEvalContext = (StandardEvaluationContext)evalContext;
    // PropertyAccessor used when the model is a BeanFactory.
    standardEvalContext.addPropertyAccessor(new BeanFactoryAccessor());
    if (beanFactory != null) {
      if (standardEvalContext.getBeanResolver() == null) {
        standardEvalContext.setBeanResolver(new BeanFactoryResolver(beanFactory));
      }
      if (standardEvalContext.getTypeLocator() == null) {
        standardEvalContext.setTypeLocator(new StandardTypeLocator(beanFactory.getBeanClassLoader()));
      }
      if (standardEvalContext.getTypeConverter() == null) {
        ConversionService conversionService = beanFactory.getConversionService();
        if (conversionService != null) {
          standardEvalContext.setTypeConverter(new StandardTypeConverter(conversionService));
        }
      }
    }
  }
}
origin: ocpsoft/rewrite

sec.setBeanResolver(new BeanFactoryResolver(beanEvaluationContext.getBeanFactory()));
sec.setTypeLocator(new StandardTypeLocator(beanEvaluationContext.getBeanFactory().getBeanClassLoader()));
ConversionService conversionService = beanEvaluationContext.getBeanFactory().getConversionService();
if (conversionService != null) {
 sec.setTypeConverter(new StandardTypeConverter(conversionService));
org.springframework.beans.factory.configConfigurableBeanFactorygetConversionService

Javadoc

Return the associated ConversionService, if any.

Popular methods of ConfigurableBeanFactory

  • resolveEmbeddedValue
    Resolve the given embedded value, e.g. an annotation attribute.
  • getBeanExpressionResolver
    Return the resolution strategy for expressions in bean definition values.
  • getBean
  • registerSingleton
    Register the given existing object as singleton in the bean factory, under the given bean name.The g
  • getTypeConverter
    Obtain a type converter as used by this BeanFactory. This may be a fresh instance for each call, sin
  • getBeanClassLoader
    Return this factory's class loader for loading bean classes (only null if even the system ClassLoade
  • containsBean
  • getMergedBeanDefinition
    Return a merged BeanDefinition for the given bean name, merging a child bean definition with its par
  • isCurrentlyInCreation
    Determine whether the specified bean is currently in creation.
  • getSingletonMutex
  • destroySingletons
    Destroy all cached singletons in this factory. To be called on shutdown of a factory.
  • getSingletonNames
  • destroySingletons,
  • getSingletonNames,
  • registerDependentBean,
  • containsSingleton,
  • destroyBean,
  • isFactoryBean,
  • isSingleton,
  • registerAlias,
  • addBeanPostProcessor

Popular in Java

  • Finding current android device location
  • findViewById (Activity)
  • putExtra (Intent)
  • getSharedPreferences (Context)
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • Socket (java.net)
    Provides a client-side TCP socket.
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • 14 Best Plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now