1 26 27 package org.objectweb.openccm.task; 28 29 import java.util.ArrayList ; 31 import java.util.Iterator ; 32 import java.util.List ; 33 import java.util.StringTokenizer ; 34 35 36 43 public class Idl2JavaApplication 44 extends LauncherApplication 45 { 46 52 53 protected String file_; 54 55 56 protected String destdir_; 57 58 59 protected String includes_; 60 61 62 protected List mapping_elements_; 63 64 70 73 public Idl2JavaApplication() 74 { 75 file_ = null; 77 destdir_ = null; 78 includes_ = null; 79 mapping_elements_ = new ArrayList (); 80 } 81 82 88 94 99 public void 100 setFile(String file) 101 { 102 file_ = file; 103 } 104 105 110 public void 111 setDestdir(String dir) 112 { 113 destdir_ = dir; 114 } 115 116 121 public void 122 setIncludes(String dirs) 123 { 124 includes_ = dirs; 125 } 126 127 130 public PackageMapping 131 createMapping() 132 { 133 PackageMapping mapping = null; 134 135 mapping = new PackageMapping(); 136 mapping_elements_.add(mapping); 138 139 return mapping; 140 } 141 142 145 public void 146 configure() 147 { 148 StringTokenizer st = null; 149 150 setXmlFile( project_properties_.getProperty("OpenCCM_HOMEDIR") + "/xml/launcher/IdlToJava.xml" ); 151 152 if (destdir_ != null) 154 { 155 addArgument("-d"); 156 addArgument(destdir_); 157 } 158 159 if (includes_ != null) 161 { 162 st = new StringTokenizer (includes_, ","); 163 while (st.hasMoreTokens()) 164 { 165 addArgument( "-I" + st.nextToken().trim() ); 166 } 167 } 168 169 for (Iterator it = mapping_elements_.iterator(); it.hasNext();) 171 { 172 addArgument("-i2jpackage"); 173 addArgument( ((PackageMapping) it.next()).asArgument() ); 174 } 175 176 addArgument(file_); 178 } 179 } 180 | Popular Tags |