Package org.springframework.beans.factory

Examples of org.springframework.beans.factory.BeanFactory.containsBean()


  public Object getValue(ELContext elContext, Object base, Object property) throws ELException {
    if (base == null) {
      String beanName = property.toString();
      BeanFactory bf = getBeanFactory(elContext);
      if (bf.containsBean(beanName)) {
        if (logger.isTraceEnabled()) {
          logger.trace("Successfully resolved variable '" + beanName + "' in Spring BeanFactory");
        }
        elContext.setPropertyResolved(true);
        return bf.getBean(beanName);
View Full Code Here


  public Class<?> getType(ELContext elContext, Object base, Object property) throws ELException {
    if (base == null) {
      String beanName = property.toString();
      BeanFactory bf = getBeanFactory(elContext);
      if (bf.containsBean(beanName)) {
        elContext.setPropertyResolved(true);
        return bf.getType(beanName);
      }
    }
    return null;
View Full Code Here

  public void setValue(ELContext elContext, Object base, Object property, Object value) throws ELException {
    if (base == null) {
      String beanName = property.toString();
      BeanFactory bf = getBeanFactory(elContext);
      if (bf.containsBean(beanName)) {
        throw new PropertyNotWritableException(
            "Variable '" + beanName + "' refers to a Spring bean which by definition is not writable");
      }
    }
  }
View Full Code Here

  public boolean isReadOnly(ELContext elContext, Object base, Object property) throws ELException {
    if (base == null) {
      String beanName = property.toString();
      BeanFactory bf = getBeanFactory(elContext);
      if (bf.containsBean(beanName)) {
        return true;
      }
    }
    return false;
  }
View Full Code Here

  private Object getModelValidator() {
    BeanFactory beanFactory = requestContext.getActiveFlow().getApplicationContext();
    if (beanFactory != null && StringUtils.hasText(modelName)) {
      String validatorName = modelName + "Validator";
      if (beanFactory.containsBean(validatorName)) {
        return beanFactory.getBean(validatorName);
      }
    }
    return null;
  }
View Full Code Here

        return requestContext.getFlowScope().get(property);
      } else if (requestContext.getConversationScope().contains(property)) {
        return requestContext.getConversationScope().get(property);
      }
      BeanFactory bf = getBeanFactory(requestContext);
      if (bf.containsBean(property)) {
        return bf.getBean(property);
      }
      return delegate.getProperty(context, target, name);
    }
View Full Code Here

      {
         log.debug("Property not a string.  Skipping");
         return null;
      }

      if (bf.containsBean((String) property))
      {
         if (log.isDebugEnabled())
         {
            log.debug("Successfully resolved property '" + property
                     + "' in root WebApplicationContext");
View Full Code Here

        GrailsPluginManager pluginManager = null;

        if (beanDefinitionRegistry instanceof HierarchicalBeanFactory) {
            HierarchicalBeanFactory beanFactory = (HierarchicalBeanFactory) beanDefinitionRegistry;
            BeanFactory parent = beanFactory.getParentBeanFactory();
            if (parent != null && parent.containsBean(GrailsPluginManager.BEAN_NAME)) {
                pluginManager = parent.getBean(GrailsPluginManager.BEAN_NAME, GrailsPluginManager.class);
            }
        }

        if (pluginManager != null) {
View Full Code Here

      {
         log.debug("Property not a string.  Skipping");
         return null;
      }

      if (bf.containsBean((String) property))
      {
         if (log.isDebugEnabled())
         {
            log.debug("Successfully resolved property '" + property
                     + "' in root WebApplicationContext");
View Full Code Here

  @Override
  public Object getValue(ELContext elContext, Object base, Object property) throws ELException {
    if (base == null) {
      String beanName = property.toString();
      BeanFactory bf = getBeanFactory(elContext);
      if (bf.containsBean(beanName)) {
        if (logger.isTraceEnabled()) {
          logger.trace("Successfully resolved variable '" + beanName + "' in Spring BeanFactory");
        }
        elContext.setPropertyResolved(true);
        return bf.getBean(beanName);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.