Examples of BeanNotOfRequiredTypeException


Examples of org.springframework.beans.factory.BeanNotOfRequiredTypeException

      }
    }

    // Check if required type matches the type of the actual bean instance.
    if (requiredType != null && bean != null && !requiredType.isAssignableFrom(bean.getClass())) {
      throw new BeanNotOfRequiredTypeException(name, requiredType, bean.getClass());
    }
    return (T) bean;
  }
View Full Code Here

Examples of org.springframework.beans.factory.BeanNotOfRequiredTypeException

            }
          });
    }

    if (!requiredType.isAssignableFrom(bean.getClass()))
      throw new BeanNotOfRequiredTypeException(bean.getClass().getName(), requiredType, bean.getClass());
    return bean;
  }
View Full Code Here

Examples of org.springframework.beans.factory.BeanNotOfRequiredTypeException

    ValueUtils.assertNotNull("requiredType", requiredType);

    Object bean = get(name);

    if (!requiredType.isAssignableFrom(bean.getClass()))
      throw new BeanNotOfRequiredTypeException(name, requiredType, bean.getClass());
    return (T) bean;
  }
View Full Code Here

Examples of org.springframework.beans.factory.BeanNotOfRequiredTypeException

      }
    }

    // Check if required type matches the type of the actual bean instance.
    if (requiredType != null && bean != null && !requiredType.isAssignableFrom(bean.getClass())) {
      throw new BeanNotOfRequiredTypeException(name, requiredType, bean.getClass());
    }
    return (T) bean;
  }
View Full Code Here

Examples of org.springframework.beans.factory.BeanNotOfRequiredTypeException

  public Object getBean(String name, Class requiredType) throws BeansException
  {
    Object bean = getBean(name);
    if (!(requiredType.isAssignableFrom(bean.getClass())))
    {
      throw new BeanNotOfRequiredTypeException(name, requiredType, bean.getClass());
    }
    return bean;
  }
View Full Code Here

Examples of org.springframework.beans.factory.BeanNotOfRequiredTypeException

    {
      throw new NoSuchBeanDefinitionException(requiredType, name);
    }
    if (!(requiredType.isAssignableFrom(bean.getClass())))
    {
      throw new BeanNotOfRequiredTypeException(name, requiredType, bean.getClass());
    }
    return bean;
  }
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.