1 16 17 package org.springframework.orm.hibernate3; 18 19 import java.util.Properties ; 20 21 import org.springframework.beans.factory.BeanNameAware; 22 import org.springframework.beans.factory.InitializingBean; 23 24 52 public class TypeDefinitionBean implements BeanNameAware, InitializingBean { 53 54 private String typeName; 55 56 private String typeClass; 57 58 private Properties parameters = new Properties (); 59 60 61 65 public void setTypeName(String typeName) { 66 this.typeName = typeName; 67 } 68 69 72 public String getTypeName() { 73 return typeName; 74 } 75 76 80 public void setTypeClass(String typeClass) { 81 this.typeClass = typeClass; 82 } 83 84 87 public String getTypeClass() { 88 return typeClass; 89 } 90 91 97 public void setParameters(Properties parameters) { 98 this.parameters = parameters; 99 } 100 101 104 public Properties getParameters() { 105 return parameters; 106 } 107 108 109 114 public void setBeanName(String name) { 115 if (this.typeName == null) { 116 this.typeName = name; 117 } 118 } 119 120 public void afterPropertiesSet() { 121 if (this.typeName == null) { 122 throw new IllegalArgumentException ("typeName is required"); 123 } 124 if (this.typeClass == null) { 125 throw new IllegalArgumentException ("typeClass is required"); 126 } 127 } 128 129 } 130 | Popular Tags |