1 16 17 package org.springframework.beans.factory.config; 18 19 import org.springframework.util.Assert; 20 21 31 public class RuntimeBeanNameReference implements BeanReference { 32 33 private final String beanName; 34 35 private Object source; 36 37 38 42 public RuntimeBeanNameReference(String beanName) { 43 Assert.hasText(beanName, "'beanName' must not be empty"); 44 this.beanName = beanName; 45 } 46 47 public String getBeanName() { 48 return beanName; 49 } 50 51 55 public void setSource(Object source) { 56 this.source = source; 57 } 58 59 public Object getSource() { 60 return source; 61 } 62 63 64 public boolean equals(Object other) { 65 if (this == other) { 66 return true; 67 } 68 if (!(other instanceof RuntimeBeanNameReference)) { 69 return false; 70 } 71 RuntimeBeanNameReference that = (RuntimeBeanNameReference) other; 72 return this.beanName.equals(that.beanName); 73 } 74 75 public int hashCode() { 76 return this.beanName.hashCode(); 77 } 78 79 public String toString() { 80 return '<' + getBeanName() + '>'; 81 } 82 83 } 84 | Popular Tags |