1 25 package org.objectweb.jonas_lib.genbase.generator; 26 27 import java.io.File ; 28 import java.util.Vector ; 29 30 import org.objectweb.common.Env; 31 32 import org.objectweb.jonas.server.JClassLoader; 33 34 35 38 public class Config { 39 40 41 public static final int PACKED = 0; 42 43 44 public static final int UNPACKED = 1; 45 46 47 private String nameJava = "java"; 48 49 50 private String nameJavac = "javac"; 51 52 55 private String nameRmic = "rmic"; 56 57 58 private Vector javacOpts = new Vector (); 59 60 61 private String javaHomeBin = null; 62 63 64 private boolean noConfig = false; 65 66 67 private boolean verbose = false; 68 69 70 private boolean debug = false; 71 72 73 private String classpath = "."; 74 75 76 private File out = new File ("."); 77 78 79 private boolean keepGenerated = false; 80 81 82 private boolean parseWithValidation = true; 83 84 85 private boolean error = false; 86 87 88 private String inputname; 89 90 91 private boolean help = false; 92 93 94 private int saveMode = PACKED; 95 96 99 private boolean dtdsAllowed = false; 100 101 105 public Config() { 106 setJavaHomeBin(System.getProperty("java.home", "")); 108 109 if (!("".equals(getJavaHomeBin()))) { 110 if (Env.isOsMacOsX()) { 111 setJavaHomeBin(getJavaHomeBin() + File.separator + "bin" + File.separator); 112 } else { 113 setJavaHomeBin(getJavaHomeBin() + File.separator + ".." + File.separator + "bin" + File.separator); 115 } 116 } 117 118 JClassLoader ucl = (JClassLoader) (Thread.currentThread().getContextClassLoader()); 120 setClasspath(ucl.getClassPath()); 121 } 122 123 126 public void setNameJavac(String nameJavac) { 127 this.nameJavac = nameJavac; 128 } 129 130 133 public String getNameJavac() { 134 return nameJavac; 135 } 136 137 140 public void setJavacOpts(Vector javacOpts) { 141 this.javacOpts = javacOpts; 142 } 143 144 147 public Vector getJavacOpts() { 148 return javacOpts; 149 } 150 151 154 public void setJavaHomeBin(String javaHomeBin) { 155 this.javaHomeBin = javaHomeBin; 156 } 157 158 161 public String getJavaHomeBin() { 162 return javaHomeBin; 163 } 164 165 168 public void setNoConfig(boolean noConfig) { 169 this.noConfig = noConfig; 170 } 171 172 175 public boolean isNoConfig() { 176 return noConfig; 177 } 178 179 182 public void setVerbose(boolean verbose) { 183 this.verbose = verbose; 184 } 185 186 189 public boolean isVerbose() { 190 return verbose; 191 } 192 193 196 public void setDebug(boolean debug) { 197 this.debug = debug; 198 } 199 200 203 public boolean isDebug() { 204 return debug; 205 } 206 207 210 public void setClasspath(String classpath) { 211 this.classpath = classpath; 212 } 213 214 217 public String getClasspath() { 218 return classpath; 219 } 220 221 224 public void setOut(File out) { 225 this.out = out; 226 } 227 228 231 public File getOut() { 232 return out; 233 } 234 235 238 public void setKeepGenerated(boolean keepGenerated) { 239 this.keepGenerated = keepGenerated; 240 } 241 242 245 public boolean isKeepGenerated() { 246 return keepGenerated; 247 } 248 249 252 public void setParseWithValidation(boolean parseWithValidation) { 253 this.parseWithValidation = parseWithValidation; 254 } 255 256 259 public boolean isParseWithValidation() { 260 return parseWithValidation; 261 } 262 263 266 public void setError(boolean error) { 267 this.error = error; 268 } 269 270 273 public boolean isError() { 274 return error; 275 } 276 277 280 public void setInputname(String inputname) { 281 this.inputname = inputname; 282 } 283 284 287 public String getInputname() { 288 return inputname; 289 } 290 291 294 public void setHelp(boolean help) { 295 this.help = help; 296 } 297 298 301 public boolean isHelp() { 302 return help; 303 } 304 305 308 public void setSavePacked() { 309 this.saveMode = PACKED; 310 } 311 312 315 public void setSaveUnpacked() { 316 this.saveMode = UNPACKED; 317 } 318 319 322 public int getSaveMode() { 323 return saveMode; 324 } 325 328 public String getNameRmic() { 329 return nameRmic; 330 } 331 334 public void setNameRmic(String nameRmic) { 335 this.nameRmic = nameRmic; 336 } 337 340 public String getNameJava() { 341 return nameJava; 342 } 343 346 public boolean isDTDsAllowed() { 347 return dtdsAllowed; 348 } 349 350 354 public void setDTDsAllowed(boolean dTDsAllowed) { 355 this.dtdsAllowed = dTDsAllowed; 356 } 357 } | Popular Tags |