1 28 29 package org.objectweb.util.launcher.parser ; 30 31 32 import java.util.Properties ; 33 34 import org.objectweb.util.launcher.StringList ; 35 import org.objectweb.util.trace.TraceSystem; 36 37 38 54 public class ContextDescription 55 { 56 57 protected String name_ ; 58 59 60 protected StringList arguments_; 61 62 63 protected Properties properties_; 64 65 66 protected StringList classpath_ ; 67 68 69 protected StringList descriptions_; 70 71 74 public ContextDescription() { 75 this.arguments_ = new StringList(); 76 this.classpath_ = new StringList(); 77 this.properties_ = new Properties (); 78 this.descriptions_ = new StringList(); 79 } 80 81 82 87 public void setName(String name) { 88 TraceSystem.get("description").debug("Setting name: \""+name+"\""); 89 name_ = name; 90 } 91 92 97 public String getName() { 98 return name_; 99 } 100 101 102 107 public void addArgument(String arg) { 108 TraceSystem.get("description").debug("Adding argument: \""+arg+"\""); 109 arguments_.add(arg); 110 } 111 112 117 public StringList getArguments() { 118 return arguments_; 119 } 120 121 122 128 public void addProperty(String key, String value) { 129 TraceSystem.get("description").debug("Adding property: \""+key+"\"=\""+value+"\""); 130 properties_.put(key,value); 131 System.getProperties().put(key,value); 132 } 133 134 139 public Properties getProperties() { 140 return properties_; 141 } 142 143 148 public void addClass(String classname) { 149 TraceSystem.get("description").debug("Adding class: \""+classname+"\""); 150 classpath_.add(classname); 151 } 152 153 158 public StringList getClasses() { 159 return classpath_; 160 } 161 162 166 public void addDescription(String desc) { 167 if (checkDescription(desc)) 168 TraceSystem.get("description").debug("Description"+desc+" has still been loaded!"); 169 else 170 descriptions_.add(desc); 171 } 172 173 178 public boolean checkDescription(String desc) { 179 return descriptions_.contains(desc); 180 } 181 } 182 | Popular Tags |