1 16 17 package org.springframework.beans.factory.xml; 18 19 import org.springframework.beans.TestBean; 20 21 27 public class InstanceFactory { 28 29 protected static int count = 0; 30 31 private String factoryBeanProperty; 32 33 public InstanceFactory() { 34 count++; 35 } 36 37 public void setFactoryBeanProperty(String s) { 38 this.factoryBeanProperty = s; 39 } 40 41 public String getFactoryBeanProperty() { 42 return this.factoryBeanProperty; 43 } 44 45 public FactoryMethods defaultInstance() { 46 TestBean tb = new TestBean(); 47 tb.setName(this.factoryBeanProperty); 48 return FactoryMethods.newInstance(tb); 49 } 50 51 54 public FactoryMethods newInstance(TestBean tb) { 55 return FactoryMethods.newInstance(tb); 56 } 57 58 public FactoryMethods newInstance(TestBean tb, int num, String name) { 59 return FactoryMethods.newInstance(tb, num, name); 60 } 61 62 } 63 | Popular Tags |