1 21 22 package com.izforge.izpack.installer; 23 24 40 public class CompileResult 41 { 42 43 public final static int SUCCESS = 42; 46 47 public final static int FAILED = 23; 48 49 public final static int ACTION_ABORT = 27; 50 51 public final static int ACTION_CONTINUE = 39; 52 53 public final static int ACTION_RECONFIGURE = 31; 54 55 private int status = SUCCESS; 58 59 private int action = ACTION_ABORT; 61 62 63 private String message = null; 64 65 66 private String [] cmdline = null; 67 68 69 private String stdout = null; 70 71 72 private String stderr = null; 73 74 75 public CompileResult() 76 { 77 this.status = SUCCESS; 78 this.action = ACTION_CONTINUE; 79 } 80 81 89 public CompileResult(String message, String [] cmdline, String stdout, String stderr) 90 { 91 this.message = message; 92 this.status = FAILED; 93 this.cmdline = cmdline; 94 this.stdout = stdout; 95 this.stderr = stderr; 96 } 97 98 public void setStatus(int status) 99 { 100 if ((status == SUCCESS) || (status == FAILED)) 101 { 102 this.status = status; 103 } 104 } 105 106 public int getStatus() 107 { 108 return this.status; 109 } 110 111 public void setAction(int action) 112 { 113 if ((action == ACTION_ABORT) || (action == ACTION_CONTINUE) 114 || (action == ACTION_RECONFIGURE)) 115 { 116 this.action = action; 117 } 118 119 } 120 121 public int getAction() 122 { 123 return this.action; 124 } 125 126 127 public boolean isSuccess() 128 { 129 return (this.status == SUCCESS); 130 } 131 132 133 public boolean isAbort() 134 { 135 return ((this.status == FAILED) && (this.action == ACTION_ABORT)); 136 } 137 138 143 public boolean isContinue() 144 { 145 return ((this.status == SUCCESS) || (this.action == ACTION_CONTINUE)); 146 } 147 148 149 public boolean isReconfigure() 150 { 151 return ((this.status == FAILED) && (this.action == ACTION_RECONFIGURE)); 152 } 153 154 159 public String getMessage() 160 { 161 return this.message; 162 } 163 164 169 public String getCmdline() 170 { 171 StringBuffer sb = new StringBuffer (); 172 for (int i = 0; i < this.cmdline.length; ++i) 173 { 174 if (sb.length() > 0) sb.append(' '); 175 sb.append(this.cmdline[i]); 176 } 177 return sb.toString(); 178 } 179 180 185 public String [] getCmdlineArray() 186 { 187 return this.cmdline; 188 } 189 190 public String getStdout() 191 { 192 return this.stdout; 193 } 194 195 public String getStderr() 196 { 197 return this.stderr; 198 } 199 200 } 201 | Popular Tags |