1 package jfun.yan; 2 3 11 final class DynamicFieldBinder implements ComponentBinder { 12 13 private final String name; 14 DynamicFieldBinder(final String name) { 15 this.name = name; 16 } 17 18 public Verifiable verify(Class type) { 19 return Components.field(type, null, name); 20 } 21 public Creator bind(Object v){ 22 return Components.field(v, name); 23 } 24 public Class bindType(Class t){ 25 return null; 26 } 27 public boolean equals(Object obj) { 28 if(obj instanceof DynamicFieldBinder){ 29 final DynamicFieldBinder other = (DynamicFieldBinder)obj; 30 return(name.equals(other.name)); 31 } 32 else return false; 33 } 34 public int hashCode() { 35 return name.hashCode(); 36 } 37 public String toString() { 38 return name; 39 } 40 } | Popular Tags |