1 26 27 package org.objectweb.util.cmdline.lib; 28 29 import java.util.List ; 31 32 33 43 public class DefaultOptionArguments 44 extends DefaultOptionBase 45 implements org.objectweb.util.cmdline.api.OptionArguments 46 { 47 53 54 protected List arguments_; 55 56 62 68 public 69 DefaultOptionArguments() 70 { 71 this("", "", (String [])null); 72 } 73 74 82 public 83 DefaultOptionArguments(String label, 84 String arguments, 85 String description) 86 { 87 this(new String [] { label }, arguments, 88 new String [] { description }); 89 } 90 91 99 public 100 DefaultOptionArguments(String [] labels, 101 String arguments, 102 String description) 103 { 104 this(labels, arguments, new String [] { description }); 105 } 106 107 115 public 116 DefaultOptionArguments(String label, 117 String arguments, 118 String [] description) 119 { 120 this(new String [] { label }, arguments, description); 121 } 122 123 131 public 132 DefaultOptionArguments(String [] labels, 133 String arguments, 134 String [] description) 135 { 136 super(labels, arguments, description); 137 138 arguments_ = new java.util.ArrayList (); 140 } 141 142 148 154 161 protected void 162 appendInternalState(StringBuffer sb) 163 { 164 super.appendInternalState(sb); 165 } 166 167 173 178 public void 179 consume(org.objectweb.util.cmdline.api.Iterator iterator) 180 { 181 addOptionValue(consumeArgument(iterator)); 182 } 183 184 190 195 public String [] 196 getOptionValues() 197 { 198 return (String []) arguments_.toArray(new String [0]); 199 } 200 201 206 public void 207 addOptionValue(String argument) 208 { 209 arguments_.add(argument); 210 } 211 212 } 218 | Popular Tags |