org.springframework.beans.factory
Class BeanNotOfRequiredTypeException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended byjava.lang.RuntimeException
              extended byorg.springframework.core.NestedRuntimeException
                  extended byorg.springframework.beans.BeansException
                      extended byorg.springframework.beans.factory.BeanNotOfRequiredTypeException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
BeanIsNotAFactoryException

public class BeanNotOfRequiredTypeException
extends BeansException

Thrown when a bean doesn't match the required type.

Author:
Rod Johnson
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.lang.RuntimeException
 
Constructor Summary
BeanNotOfRequiredTypeException(String beanName, Class requiredType, Class actualType)
          Create a new BeanNotOfRequiredTypeException.
 
Method Summary
 Class getActualType()
          Return the actual type of the instance found.
 String getBeanName()
          Return the name of the instance that was of the wrong type.
 Class getRequiredType()
          Return the required type for the bean.
 
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getCause, getMessage, printStackTrace, printStackTrace
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getStackTrace, initCause, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BeanNotOfRequiredTypeException

public BeanNotOfRequiredTypeException(String beanName,
                                      Class requiredType,
                                      Class actualType)
Create a new BeanNotOfRequiredTypeException.

Parameters:
beanName - the name of the bean requested
requiredType - the required type
actualType - the actual type returned, which did not match the expected type
Method Detail

getBeanName

public String getBeanName()
Return the name of the instance that was of the wrong type.


getRequiredType

public Class getRequiredType()
Return the required type for the bean.


getActualType

public Class getActualType()
Return the actual type of the instance found.



Copyright (C) 2003-2004 The Spring Framework Project.