1 26 27 package org.objectweb.util.cmdline.lib; 28 29 import org.objectweb.util.cmdline.api.Usage; 30 import org.objectweb.util.misc.lib.DefaultPrintableBase; 31 32 33 41 42 public class DefaultUsage 43 extends DefaultPrintableBase 44 implements Usage 45 { 46 52 53 protected String [] labels_; 54 55 56 protected String [] arguments_; 57 58 59 protected String [] description_; 60 61 62 private boolean additionalArguments_; 63 64 70 76 public 77 DefaultUsage() 78 { 79 this(new String [] { "" }, new String [0], null); 80 } 81 82 90 public 91 DefaultUsage(String label, 92 String argument, 93 String [] description) 94 { 95 this(new String [] { label }, new String [] { argument }, description); 96 } 97 98 106 public 107 DefaultUsage(String label, 108 String [] arguments, 109 String [] description) 110 { 111 this(new String [] { label }, arguments, description); 112 } 113 114 122 public 123 DefaultUsage(String [] labels, 124 String argument, 125 String [] description) 126 { 127 this(labels, new String [] { argument }, description); 128 } 129 130 138 public 139 DefaultUsage(String [] labels, 140 String [] arguments, 141 String [] description) 142 { 143 this(labels,arguments,false,description); 144 } 145 146 155 public 156 DefaultUsage(String [] labels, 157 String [] arguments, 158 boolean additional, 159 String [] description) { 160 setLabels(labels); 161 setArguments(arguments); 162 setAdditionalArguments(additional); 163 setDescription(description); 164 } 165 166 167 173 179 186 protected void 187 appendInternalState(StringBuffer sb) 188 { 189 append(sb, "labels", getLabels()); 190 append(sb, "arguments", getArguments()); 191 append(sb, "description", getDescription()); 192 } 193 194 200 205 public String [] 206 getLabels() 207 { 208 return labels_; 209 } 210 211 216 public void 217 setLabels(String [] labels) 218 { 219 labels_ = labels; 220 } 221 222 227 public String [] 228 getArguments() 229 { 230 return arguments_; 231 } 232 233 238 public void 239 setArguments(String [] arguments) 240 { 241 arguments_ = arguments; 242 } 243 244 249 public boolean 250 getAdditionalArguments() { 251 return additionalArguments_; 252 } 253 254 259 public void 260 setAdditionalArguments(boolean additional) { 261 additionalArguments_ = additional; 262 } 263 264 269 public String [] 270 getDescription() 271 { 272 return description_; 273 } 274 275 280 public void 281 setDescription(String [] description) 282 { 283 description_ = description; 284 } 285 286 } 292 | Popular Tags |