1 26 27 package org.objectweb.util.cmdline.lib; 28 29 import org.objectweb.util.cmdline.api.OptionArgument ; 30 31 39 40 public class DefaultOptionArgument 41 extends DefaultOptionBase 42 implements OptionArgument 43 { 44 50 51 protected String argument_; 52 53 59 65 public 66 DefaultOptionArgument() 67 { 68 this("", "", (String [])null, null); 69 } 70 71 80 public 81 DefaultOptionArgument(String label, 82 String arguments, 83 String description, 84 String argument) 85 { 86 this(new String [] { label }, arguments, 87 new String [] { description }, argument); 88 } 89 90 99 public 100 DefaultOptionArgument(String [] labels, 101 String arguments, 102 String description, 103 String argument) 104 { 105 this(labels, arguments, new String [] { description }, argument); 106 } 107 108 117 public 118 DefaultOptionArgument(String label, 119 String arguments, 120 String [] description, 121 String argument) 122 { 123 this(new String [] { label }, arguments, description, argument); 124 } 125 126 135 public 136 DefaultOptionArgument(String [] labels, 137 String arguments, 138 String [] description, 139 String argument) 140 { 141 super(labels, arguments, description); 142 setArgument(argument); 143 } 144 145 151 157 164 protected void 165 appendInternalState(StringBuffer sb) 166 { 167 super.appendInternalState(sb); 168 append(sb, "argument", getArgument()); 169 } 170 171 177 182 public void 183 consume(org.objectweb.util.cmdline.api.Iterator iterator) 184 { 185 checkAlreadySet(iterator); 186 setArgument(consumeArgument(iterator)); 187 } 188 189 195 200 public String 201 getArgument() 202 { 203 return argument_; 204 } 205 206 211 public void 212 setArgument(String argument) 213 { 214 argument_ = argument; 215 } 216 217 } 223 | Popular Tags |