org.springframework.beans.factory
Class BeanNotOfRequiredTypeException

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--java.lang.RuntimeException
                    |
                    +--org.springframework.core.NestedRuntimeException
                          |
                          +--org.springframework.beans.BeansException
                                |
                                +--org.springframework.beans.factory.BeanNotOfRequiredTypeException
Direct Known Subclasses:
BeanIsNotAFactoryException

public class BeanNotOfRequiredTypeException
extends BeansException

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

Author:
Rod Johnson

Constructor Summary
BeanNotOfRequiredTypeException(String name, Class requiredType, Object actualInstance)
          Creates new BeanNotOfRequiredTypeException.

Method Summary
 ObjectgetActualInstance()
           
 ClassgetActualType()
           
 StringgetBeanName()
           
 ClassgetRequiredType()
           

Methods inherited from class org.springframework.core.NestedRuntimeException
getCause, getMessage, printStackTrace, printStackTrace

Methods inherited from class java.lang.Throwable
printStackTrace, getStackTrace, setStackTrace, getLocalizedMessage, toString, fillInStackTrace, initCause

Methods inherited from class java.lang.Object
hashCode, notify, notifyAll, wait, wait, wait, getClass, equals

Constructor Detail

BeanNotOfRequiredTypeException

public BeanNotOfRequiredTypeException(String name, Class requiredType, Object actualInstance)
Creates new BeanNotOfRequiredTypeException.
Parameters:
name - name of the bean requested
requiredType - required type
actualInstance - the instance actually returned, whose class did not match the expected type.
Method Detail

getActualInstance

public Object getActualInstance()

getActualType

public Class getActualType()

getBeanName

public String getBeanName()

getRequiredType

public Class getRequiredType()

Association Links

to Class java.lang.String

The name of the instance that was of the wrong type

to Class java.lang.Class

The required type