1 23 package org.hammurapi; 24 25 import java.io.File ; 26 import java.util.HashMap ; 27 import java.util.Iterator ; 28 import java.util.Map ; 29 30 import org.apache.tools.ant.Project; 31 32 import com.pavelvlasov.ant.Param; 33 import com.pavelvlasov.config.ConfigurationException; 34 import com.pavelvlasov.config.Parameterizable; 35 36 42 public class StyleSheetEntry { 43 44 private String name; 45 private File file; 46 private String url; 47 private Map parameters=new HashMap (); 48 49 52 public String getName() { 53 return name; 54 } 55 56 71 public void setName(String name) { 72 this.name=name; 73 } 74 75 78 public File getFile() { 79 return file; 80 } 81 82 85 public String getUrl() { 86 return url; 87 } 88 89 94 public void setFile(File file) { 95 this.file=file; 96 } 97 98 103 public void setUrl(String url) { 104 this.url=url; 105 } 106 107 110 public Map getParameters() { 111 return parameters; 112 } 113 114 118 public void setParameters(Map parameters) { 119 this.parameters.putAll(parameters); 120 } 121 122 127 public void addConfiguredParameter(Param param) { 128 parameters.put(param.getName(), param); 129 } 130 131 void setParameters(Project project, Parameterizable p) throws ConfigurationException { 132 Iterator pit=parameters.values().iterator(); 133 while (pit.hasNext()) { 134 Param param=(Param) pit.next(); 135 136 param.setProject(project); 137 param.execute(); 138 139 Object value=param.getObject(null); 140 if (value!=null) { 141 p.setParameter(param.getName(), value); 142 } 143 } 144 } 145 } 146 | Popular Tags |