1 26 27 package org.objectweb.openccm.packaging.cmdline; 28 29 import org.objectweb.util.cmdline.lib.DefaultOptionBase; 31 32 33 41 42 public abstract class OptionBase 43 extends DefaultOptionBase 44 { 45 51 52 private PATApplication application_; 53 54 60 61 public 62 OptionBase() 63 { 64 super(); 66 67 setArguments(new String [0]); 68 setMandatory(false); 69 70 application_ = null; 72 } 73 74 80 86 93 public boolean 94 check(String current) 95 { 96 String baseOptionLabel = getBaseOptionLabel(); 97 98 if (!current.startsWith(baseOptionLabel)) 99 { 100 return false; 101 } 102 103 consumeOption(current.substring(baseOptionLabel.length())); 104 return true; 105 } 106 107 112 public void 113 consume(org.objectweb.util.cmdline.api.Iterator iterator) 114 { 115 } 117 118 123 public PATApplication 124 getApplication() 125 { 126 return application_; 127 } 128 129 134 public void 135 setApplication(PATApplication application) 136 { 137 application_ = application; 138 } 139 140 145 abstract public String 146 getBaseOptionLabel(); 147 148 153 abstract public void 154 consumeOption(String current); 155 156 } | Popular Tags |