1 package net.sf.invicta.project; 2 3 import java.util.ArrayList ; 4 import java.util.List ; 5 import java.util.Map ; 6 7 import net.sf.invicta.api.Property; 8 9 import org.apache.commons.collections.SequencedHashMap; 10 11 14 public class ProjectSettings { 15 private String name; 16 private String generalComponentName; 17 private Map properties = new SequencedHashMap(); 18 private String dir; 19 private String version; 20 private String release; 21 private String globalComponent; 22 23 26 public ProjectSettings() { 27 super(); 28 } 29 30 34 public void addProperty(PropertyImpl property) { 35 this.properties.put(property.getName(), property); 36 } 37 38 43 public Property getProperty(String propertyName) { 44 return (Property)this.properties.get(propertyName); 45 } 46 47 52 public String getPropertyValue(String propertyName) { 53 Property property = (Property)this.properties.get(propertyName); 54 if (property == null) 55 return null; 56 57 return property.getValue(); 58 } 59 60 64 public Map getPropertiesMap() { 65 return this.properties; 66 } 67 68 72 public List getProperties() { 73 return (List )new ArrayList (this.properties.values()); 74 } 75 76 82 public void setProperty(String propertyName, String propertyValue, String description) { 83 this.properties.put(propertyName, new PropertyImpl(propertyName, propertyValue, description)); 84 } 85 86 90 public String getGeneralComponentName() { 91 return this.generalComponentName; 92 } 93 94 98 public String getName() { 99 return name; 100 } 101 102 106 public void setName(String name) { 107 setProperty("projectName", name, "Project Name"); 108 this.name = name; 109 } 110 111 115 public String getDir() { 116 return dir; 117 } 118 119 123 public String getRelease() { 124 return release; 125 } 126 127 131 public String getVersion() { 132 return version; 133 } 134 135 139 public void setDir(String dir) { 140 setProperty("dir", dir, "Project Directory"); 141 this.dir = dir; 142 } 143 144 148 public void setRelease(String release) { 149 setProperty("release", release, "Project Release"); 150 this.release = release; 151 } 152 153 157 public void setVersion(String version) { 158 setProperty("version", version, "Project Version"); 159 this.version = version; 160 } 161 162 165 public String getGlobalComponent() { 166 return globalComponent; 167 } 168 169 172 public void setGlobalComponent(String string) { 173 globalComponent = string; 174 } 175 176 } 177 | Popular Tags |