1 package jfun.yan; 2 3 import jfun.yan.factory.Factory; 4 5 abstract class ClosureableComponent extends DecoratingComponent { 6 7 protected ClosureableComponent(Component cc) { 8 super(cc); 9 10 } 11 public Component factory(Class factory_type, String toString) { 12 if(Factory.class.equals(factory_type)){ 13 return factory(toString); 14 } 15 else return super.factory(factory_type, toString); 16 } 17 public Component factory(String toString) { 18 return decorate(getDelegateTarget().factory(toString)); 19 } 20 } 21 | Popular Tags |