1 28 29 package org.objectweb.openccm.corba.idl2java; 30 31 import org.objectweb.util.cmdline.api.CommandLine; 33 import org.objectweb.util.cmdline.api.OptionArgument; 34 import org.objectweb.util.cmdline.api.OptionArguments; 35 import org.objectweb.util.cmdline.lib.ApplicationBase; 36 import org.objectweb.util.cmdline.lib.DefaultCommandLine; 37 import org.objectweb.util.cmdline.lib.DefaultOptionArgument; 38 import org.objectweb.util.cmdline.lib.DefaultOptionArguments; 39 40 import org.objectweb.openccm.command.lib.ReleaseInfo; 41 42 50 public abstract class IdlToJavaApplicationBase 51 extends ApplicationBase 52 implements IdlToJavaOperations 53 { 54 60 61 protected OptionArgument destdir_opt_; 63 64 protected PreprocessorOption include_opt_; 66 67 protected OptionArguments i2jpackage_opt_; 69 75 78 public 79 IdlToJavaApplicationBase() 80 { 81 this(new DefaultCommandLine("idl2java", 82 "omg_idl_file", 83 "Generate Java Mapping from an OMG IDL 2.0 file.", 84 true), 85 true); 86 } 87 88 94 public IdlToJavaApplicationBase(CommandLine commandLine, 95 boolean withDefaultOptions) 96 { 97 this(commandLine,withDefaultOptions,true); 98 } 99 100 107 public IdlToJavaApplicationBase(CommandLine commandLine, 108 boolean withDefaultOptions, 109 boolean withPreprocessorOptions) 110 { 111 super(commandLine, withDefaultOptions); 113 114 destdir_opt_ = new DefaultOptionArgument( 116 "-d", 117 "destdir", 118 "Set the destination directory name, default is .", 119 "."); 120 commandLine.addOption(destdir_opt_); 121 122 include_opt_ = new OptionIDIR(this); 124 commandLine.addOption(include_opt_); 125 126 i2jpackage_opt_ = new DefaultOptionArguments( 128 "-i2jpackage", 129 "idl.module:java.pkg", 130 "Define the target Java package for an OMG IDL module"); 131 commandLine.addOption(i2jpackage_opt_); 132 } 133 134 140 146 153 public String 154 getIdentity() 155 { 156 return getCommandLine().getLabels()[0] 157 + ' ' + ReleaseInfo.VERSION; 158 } 159 160 166 171 public String [] 172 getVersionInformation() 173 { 174 String [] result = super.getVersionInformation(); 175 result[0] = ReleaseInfo.NAME_SHORT + ' ' 176 + getIdentity() 177 + " (on top of " 178 + System.getProperty("orb.name", "UNKNOWN") 179 + ' ' 180 + System.getProperty("orb.version", "X.X") 181 + ')'; 182 return result; 183 } 184 185 191 } 192 | Popular Tags |