1 6 package org.jfox.ioc.depend; 7 8 9 10 16 17 public class DependencyPack { 18 21 private String name; 22 25 private Dependency param; 26 29 private String description = ""; 30 31 public static DependencyPack[] EMPTY_PARAMETER_PACKS = new DependencyPack[]{}; 32 33 public DependencyPack(String name, Dependency param) { 34 this(name,param,null); 35 } 36 37 public DependencyPack(String name, Dependency param, String description) { 38 if(name == null || name.trim().equals("")) { 39 throw new IllegalArgumentException ("setter name should not be null or empty."); 40 } 41 this.name = name; 42 this.param = param; 43 this.description = description; 44 } 45 46 49 public String getName() { 50 return "set" + name.substring(0, 1).toUpperCase() + name.substring(1); 51 } 52 53 57 public Dependency getParameter() { 58 return param; 59 } 60 61 65 public String getDescription() { 66 if(description == null) { 67 description = getName(); 68 } 69 return description; 70 } 71 72 public void setDescription(String description) { 73 this.description = description; 74 } 75 76 public String toString() { 77 StringBuffer sb = new StringBuffer ("PropertyParameterPack["); 78 if(param != null) sb.append(param.toString()); 79 sb.append("]"); 80 return sb.toString(); 81 82 } 83 84 public static void main(String [] args) { 85 86 } 87 } 88 | Popular Tags |