1 28 29 package org.objectweb.util.cpp.lib; 30 31 import org.objectweb.util.cmdline.lib.DefaultOptionBase; 32 import org.objectweb.util.cpp.api.Preprocessor; 33 import org.objectweb.util.cpp.api.PreprocessorOption; 34 35 44 45 public abstract class PreprocessorOptionBase 46 extends DefaultOptionBase 47 implements PreprocessorOption 48 { 49 55 56 private Preprocessor preprocessor_; 57 58 64 65 public PreprocessorOptionBase() { 66 super(); 68 69 setArguments(new String [0]); 70 setMandatory(false); 71 72 preprocessor_ = null; 74 } 75 76 82 88 95 public boolean check(String current) { 96 String baseOptionLabel = getBaseOptionLabel(); 97 98 if (!current.startsWith(baseOptionLabel)) { 99 return false; 100 } 101 102 consumeOption(current.substring(baseOptionLabel.length())); 103 return true; 104 } 105 106 111 public void 112 consume(org.objectweb.util.cmdline.api.Iterator iterator) { 113 } 115 116 122 127 public Preprocessor getPreprocessor() { 128 return preprocessor_; 129 } 130 131 136 public void setPreprocessor(Preprocessor preprocessor) { 137 preprocessor_ = preprocessor; 138 } 139 140 146 151 public abstract String getBaseOptionLabel(); 152 153 158 public abstract void consumeOption(String current); 159 160 } 166 | Popular Tags |