1 package jfun.yan; 2 3 import jfun.yan.factory.Pool; 4 5 final class NilComponent extends Component { 6 public Class getType() { 7 return void.class; 8 } 9 public boolean isConcrete(){ 10 return false; 11 } 12 public Object create(Dependency dep){ 13 return null; 14 } 15 16 public Class verify(Dependency dep) { 17 return void.class; 18 } 19 public String toString() { 20 return "null"; 21 } 22 23 public final Component singleton(){return this;} 24 public final Component singleton(Pool pool){return this;} 25 public final Component guard(){return this;} 26 public final Component proxy(){ 27 return this; 28 } 29 public final Component proxy(Class type){ 30 return subsume(type); 31 } 32 private NilComponent(){} 33 static final Component instance = new NilComponent(); 34 public boolean isSingleton(){ 35 return true; 36 } 37 } 38 | Popular Tags |