1 package org.myoodb.core; 25 26 import org.myoodb.*; 27 28 public abstract class AbstractDatabase implements AbstractInterface 29 { 30 public static String createSignature(Class [] sig) 31 { 32 if ((sig == null) || (sig.length == 0)) 33 { 34 return null; 35 } 36 37 StringBuilder signature = new StringBuilder (sig[0].getName()); 38 for (int i = 1; i < sig.length; i++) 39 { 40 signature.append(MethodHelper.SIGNATURE_DELIMITER); 41 signature.append(sig[i].getName()); 42 } 43 44 return signature.toString(); 45 } 46 47 public final MyOodbProxy createRoot(Class classType, String rootName) 48 { 49 return createRoot(classType.getName(), rootName); 50 } 51 52 public final MyOodbProxy createRoot(Class [] classTypes, String rootName) 53 { 54 return createRoot(createSignature(classTypes), rootName); 55 } 56 57 public final MyOodbProxy createRoot(String className, String rootName) 58 { 59 return createRoot(className, rootName, (String ) null, null); 60 } 61 62 public final MyOodbProxy createRoot(Class classType, String rootName, String sig, Object [] args) 63 { 64 return createRoot(classType.getName(), rootName, sig, args); 65 } 66 67 public final MyOodbProxy createRoot(Class classType, String rootName, Class [] sig, Object [] args) 68 { 69 return createRoot(classType.getName(), rootName, createSignature(sig), args); 70 } 71 72 public final MyOodbProxy createRoot(String className, String rootName, Class [] sig, Object [] args) 73 { 74 return createRoot(className, rootName, createSignature(sig), args); 75 } 76 77 public final MyOodbProxy createObject(Class classType) 78 { 79 return createObject(classType.getName()); 80 } 81 82 public final MyOodbProxy createObject(Class [] classTypes) 83 { 84 return createObject(createSignature(classTypes)); 85 } 86 87 public final MyOodbProxy createObject(String className) 88 { 89 return createObject(className, (String ) null, null); 90 } 91 92 public final MyOodbProxy createObject(Class classType, String sig, Object [] args) 93 { 94 return createObject(classType.getName(), sig, args); 95 } 96 97 public final MyOodbProxy createObject(Class classType, Class [] sig, Object [] args) 98 { 99 return createObject(classType.getName(), createSignature(sig), args); 100 } 101 102 public final MyOodbProxy createObject(String className, Class [] sig, Object [] args) 103 { 104 return createObject(className, createSignature(sig), args); 105 } 106 } 107 | Popular Tags |