1 21 22 25 package net.sf.launch4j.config; 26 27 import net.sf.launch4j.binding.IValidatable; 28 import net.sf.launch4j.binding.Validator; 29 30 33 public class Msg implements IValidatable { 34 private String startupErr; 35 private String bundledJreErr; 36 private String jreVersionErr; 37 private String launcherErr; 38 39 public void checkInvariants() { 40 Validator.checkOptString(startupErr, 1024, "startupErr", 41 Messages.getString("Msg.startupErr")); 42 Validator.checkOptString(bundledJreErr, 1024, "bundledJreErr", 43 Messages.getString("Msg.bundledJreErr")); 44 Validator.checkOptString(jreVersionErr, 1024, "jreVersionErr", 45 Messages.getString("Msg.jreVersionErr")); 46 Validator.checkOptString(launcherErr, 1024, "launcherErr", 47 Messages.getString("Msg.launcherErr")); 48 } 49 50 public String getStartupErr() { 51 return !Validator.isEmpty(startupErr) ? startupErr 52 : "An error occurred while starting the application."; 53 } 54 55 public void setStartupErr(String startupErr) { 56 this.startupErr = startupErr; 57 } 58 59 public String getBundledJreErr() { 60 return !Validator.isEmpty(bundledJreErr) ? bundledJreErr 61 : "This application was configured to use a bundled Java Runtime" + 62 " Environment but the runtime is missing or corrupted."; 63 } 64 65 public void setBundledJreErr(String bundledJreErr) { 66 this.bundledJreErr = bundledJreErr; 67 } 68 69 public String getJreVersionErr() { 70 return !Validator.isEmpty(jreVersionErr) ? jreVersionErr 71 : "This application requires a Java Runtime Environment"; 72 } 73 74 public void setJreVersionErr(String jreVersionErr) { 75 this.jreVersionErr = jreVersionErr; 76 } 77 78 public String getLauncherErr() { 79 return !Validator.isEmpty(launcherErr) ? launcherErr 80 : "The registry refers to a nonexistent Java Runtime Environment" + 81 " installation or the runtime is corrupted."; 82 } 83 84 public void setLauncherErr(String launcherErr) { 85 this.launcherErr = launcherErr; 86 } 87 } 88 | Popular Tags |