1 2 package SOFA.SOFAnode.Made.CodeGen; 3 4 import SOFA.SOFAnode.Made.TIR.Contained; 5 import SOFA.SOFAnode.Made.TIR.Identification; 6 7 10 public class Debug { 11 12 public static void println(String msg) { 13 if ((System.getProperty("codegen.debug", "no").compareTo("yes"))==0) 14 System.out.println("*** "+msg+" ***"); 15 } 16 17 public static boolean isDebug() { 18 if ((System.getProperty("codegen.debug", "no").compareTo("yes"))==0) 19 return true; 20 return false; 21 } 22 23 public static void println(Object obj) { 24 if ((System.getProperty("codegen.debug", "no").compareTo("yes"))==0) 25 System.out.println("*** "+obj.toString()+" ***"); 26 } 27 28 public static void println(Object [] obj) { 29 if ((System.getProperty("codegen.debug", "no").compareTo("yes"))==0) { 30 System.out.println("***"); 31 for (int i=0;i<obj.length;i++) { 32 System.out.println(obj[i].toString()); 33 } 34 System.out.println("***"); 35 } 36 } 37 38 39 public static void println(Contained[] obj) { 40 if ((System.getProperty("codegen.debug", "no").compareTo("yes"))==0) { 41 System.out.println("***"); 42 for (int i=0;i<obj.length;i++) { 43 try { 44 Identification id = obj[i].get_identification(); 45 System.out.println(id.absolute_name().name()+"?"+id.version()); 46 } catch (java.rmi.RemoteException e) { 47 System.out.println(" Remote exception --> "+e.getMessage()); 48 } 49 } 50 System.out.println("***"); 51 } 52 } 53 54 55 public static void println(ObjectList obj) { 56 if ((System.getProperty("codegen.debug", "no").compareTo("yes"))==0) { 57 System.out.println("***"); 58 for (int i=0;i<obj.size();i++) { 59 try { 60 Identification id = obj.getObject(i).get_identification(); 61 System.out.println(id.absolute_name().name()+"?"+id.version()); 62 } catch (java.rmi.RemoteException e) { 63 System.out.println(" Remote exception --> "+e.getMessage()); 64 } 65 } 66 System.out.println("***"); 67 } 68 } 69 70 71 public static void println(GenObjectList obj) { 72 if ((System.getProperty("codegen.debug", "no").compareTo("yes"))==0) { 73 System.out.println("***"); 74 for (int i=0;i<obj.size();i++) { 75 System.out.println(obj.getObject(i).toString()); 76 } 77 System.out.println("***"); 78 } 79 } 80 } 81 | Popular Tags |