1 16 17 package org.springframework.beans.factory; 18 19 import org.springframework.beans.FatalBeanException; 20 import org.springframework.core.io.Resource; 21 22 31 public class BeanDefinitionStoreException extends FatalBeanException { 32 33 private String resourceDescription; 34 35 private String beanName; 36 37 38 42 public BeanDefinitionStoreException(String msg) { 43 super(msg); 44 } 45 46 51 public BeanDefinitionStoreException(String msg, Throwable cause) { 52 super(msg, cause); 53 } 54 55 60 public BeanDefinitionStoreException(String resourceDescription, String msg) { 61 super(msg); 62 this.resourceDescription = resourceDescription; 63 } 64 65 71 public BeanDefinitionStoreException(String resourceDescription, String msg, Throwable cause) { 72 super(msg, cause); 73 this.resourceDescription = resourceDescription; 74 } 75 76 83 public BeanDefinitionStoreException(String resourceDescription, String beanName, String msg) { 84 this(resourceDescription, beanName, msg, null); 85 } 86 87 95 public BeanDefinitionStoreException(String resourceDescription, String beanName, String msg, Throwable cause) { 96 super("Error registering bean with name '" + beanName + "' defined in " + resourceDescription + ": " + msg, cause); 97 this.resourceDescription = resourceDescription; 98 this.beanName = beanName; 99 } 100 101 111 public BeanDefinitionStoreException(Resource documentLocation, String beanName, String msg) { 112 this(documentLocation.getDescription(), beanName, msg, null); 113 } 114 115 126 public BeanDefinitionStoreException(Resource documentLocation, String beanName, String msg, Throwable cause) { 127 this(documentLocation.getDescription(), beanName, msg, cause); 128 } 129 130 131 135 public String getResourceDescription() { 136 return this.resourceDescription; 137 } 138 139 142 public String getBeanName() { 143 return this.beanName; 144 } 145 146 } 147 | Popular Tags |