1 26 27 package org.objectweb.ccm.visitorIDL3.common; 28 29 36 37 public class Generator 38 { 39 45 48 private Printer printer_; 49 50 53 private org.objectweb.ccm.IDL3.Repository repository_; 54 55 58 private java.lang.String template_location_; 59 60 66 69 public 70 Generator(org.objectweb.ccm.IDL3.Repository repository) 71 { 72 repository_ = repository; 74 printer_ = null; 75 template_location_ = System.getProperty("ccm.templates"); 79 } 80 81 87 93 96 public void 97 setPrinter(Printer printer) 98 { 99 printer_ = printer; 100 } 101 102 105 public java.lang.String 106 getTemplateLocation() 107 { 108 return template_location_; 109 } 110 111 114 public java.lang.String 115 visitObj(java.lang.String name) 116 { 117 org.objectweb.ccm.IDL3.Declaration decl = null; 118 119 if (name.equals("::")) 120 decl = repository_; 121 else 122 decl = repository_.lookup(name); 123 124 if (decl==null) 125 { 126 java.lang.String msg = 127 "error in class org.objectweb.ccm.visitorIDL3.Generator\n"+ 128 " operation : visit_obj\n"+ 129 " message : object " + name + " not found : aborting generation !"; 130 throw new Error (msg); 131 } 132 133 java.lang.String [] aliases = { "obj" }; 134 java.lang.Object [] objs = { decl }; 135 printer_.map("OBJECT", aliases, objs); 136 137 return ""; 138 } 139 } 140 | Popular Tags |