1 28 29 package org.objectweb.ccm.scripts; 30 31 34 public class IR3toXMI 35 extends org.objectweb.openccm.corba.Application { 36 37 40 public IR3toXMI() { 41 } 42 43 48 public static void 49 main(java.lang.String [] args) { 50 IR3toXMI ir3 = new IR3toXMI(); 51 ir3.start(args); 52 } 53 54 57 58 65 public int 66 run(java.lang.String [] args) { 67 org.objectweb.openccm.ir3.api.ComponentRepository repositoryRef = 69 org.objectweb.openccm.ir3.api.ComponentRepositoryHelper.narrow( 70 org.objectweb.openccm.corba.TheInterfaceRepository.getRepository()); 71 72 XMICompiler compiler = new XMICompiler( 74 new IR3XMIOptionsManager(org.objectweb.ccm.scripts.Version.label, 75 "ir3_xmi"), 76 org.objectweb.ccm.scripts.Version.label); 77 78 boolean ok = compiler.run(args); 80 if (!ok) { 81 return -1; 82 } 83 84 String filename = "stdout"; 86 String xmidtd = "xmi.dtd"; 87 88 IR3XMIOptionsManager manager = compiler.getManager(); 90 91 if (manager.isSet("-o")) { 93 filename = manager.get("-o")[0]; 94 } 95 96 if (manager.isSet("-dtd")) { 97 xmidtd = manager.get("-dtd")[0]; 98 } 99 100 org.objectweb.ccm.IDL3.Repository rep = 102 new org.objectweb.ccm.IDL3.Repository( 103 repositoryRef.as_IDL3_repository()); 104 105 try { 106 org.objectweb.ccm.visitorIDL3.xmi.IDL3_XMI mi = 107 new org.objectweb.ccm.visitorIDL3.xmi.IDL3_XMI(rep); 108 109 mi.generate(manager.getObjectName(), filename, xmidtd); 111 } catch(fr.lifl.cim.jidlscript.lang.JISError ex) { 112 System.err.println(ex.exception.toString()); 113 return 1; 114 } 115 116 return 0; 117 } 118 } 119 | Popular Tags |