1 16 17 package org.springframework.beans.factory; 18 19 import org.springframework.beans.BeansException; 20 21 28 public class NoSuchBeanDefinitionException extends BeansException { 29 30 31 private String beanName; 32 33 34 private Class beanType; 35 36 37 41 public NoSuchBeanDefinitionException(String name) { 42 super("No bean named '" + name + "' is defined"); 43 this.beanName = name; 44 } 45 46 51 public NoSuchBeanDefinitionException(String name, String message) { 52 super("No bean named '" + name + "' is defined: " + message); 53 this.beanName = name; 54 } 55 56 61 public NoSuchBeanDefinitionException(Class type, String message) { 62 super("No unique bean of type [" + type.getName() + "] is defined: " + message); 63 this.beanType = type; 64 } 65 66 67 71 public String getBeanName() { 72 return this.beanName; 73 } 74 75 79 public Class getBeanType() { 80 return this.beanType; 81 } 82 83 } 84 | Popular Tags |