1 23 24 25 26 31 32 package com.sun.jdo.spi.persistence.support.ejb.ejbc; 33 34 import java.io.*; 35 36 import java.text.MessageFormat ; 37 import java.util.HashMap ; 38 import java.util.Properties ; 39 import java.util.StringTokenizer ; 40 41 import com.sun.jdo.spi.persistence.utility.generator.JavaClassWriterHelper; 42 43 53 class CMP11TemplateFormatter extends CMPTemplateFormatter { 54 55 private final static String templateFile = 56 "com/sun/jdo/spi/persistence/support/ejb/ejbc/CMP11Templates.properties"; 58 public final static String one_oneVariables_ = "one_oneVariables"; public final static String ejbQuerySetIgnoreCache_ = "ejbQuerySetIgnoreCache"; 62 public final static String helper11Interface_ 64 = "com.sun.jdo.spi.persistence.support.sqlstore.ejb.JDOEJB11Helper"; public final static String helper11Impl_ 66 = "com.sun.jdo.spi.persistence.support.ejb.cmp.JDOEJB11HelperImpl"; 68 public final static String ejbCreate1_1_ = "ejbCreate1_1"; public final static String ejbCreateUnknownPK1_1_ = "ejbCreateUnknownPK1_1"; public final static String ejbPostCreate1_1_ = "ejbPostCreate1_1"; public final static String ejbRemove1_1_ = "ejbRemove1_1"; public final static String storeFields1_1_ = "jdoStoreFields"; public final static String loadFields1_1_ = "jdoLoadFields"; public final static String setEntityContext1_1_ = "setEntityContext1_1"; public final static String internalMethods1_1_ = "internalMethods1_1"; public final static String helperMethods1_1_ = "helperMethods1_1"; public final static String load1_1_ = "load1_1"; public final static String store1_1_ = "store1_1"; public final static String assertPKStore1_1_ = "assertPKStore1_1"; public final static String pkstore1_1_ = "pkstore1_1"; public final static String pkstringstore1_1_ = "pkstringstore1_1"; public final static String pkcopystore1_1_ = "pkcopystore1_1"; public final static String copyload1_1_ = "copyload1_1"; public final static String copystore1_1_ = "copystore1_1"; public final static String arrayload1_1_ = "arrayload1_1"; public final static String arraystore1_1_ = "arraystore1_1"; public final static String loadSerializable1_1_ = "loadSerializable1_1"; public final static String storeSerializable1_1_ = "storeSerializable1_1"; 91 public final static String signature1_1_ = "signature1_1"; 94 public static MessageFormat querysetignorecacheformatter = null; 97 public static MessageFormat c11formatter = null; public static MessageFormat c11unpkformatter = null; public static MessageFormat postc11formatter = null; public static MessageFormat l11formatter = null; public static MessageFormat s11formatter = null; public static MessageFormat l11copyformatter = null; public static MessageFormat s11copyformatter = null; public static MessageFormat l11arrayformatter = null; public static MessageFormat s11arrayformatter = null; public static MessageFormat assertpks11formatter = null; public static MessageFormat pks11formatter = null; public static MessageFormat pkstring11formatter = null; public static MessageFormat pkcopy11formatter = null; public static MessageFormat l11Serializableformatter = null; public static MessageFormat s11Serializableformatter = null; 114 public static String one_oneVariablesTemplate = null; 117 public static String ejbRemove1_1Template = null; 118 public static String signature1_1Template = null; 119 120 private static boolean is11HelpersLoaded = false; 121 122 125 CMP11TemplateFormatter() { 126 } 127 128 131 static synchronized void initHelpers() throws IOException { 132 if (is11HelpersLoaded == false) { 133 loadProperties(helpers, templateFile); 134 init11Formatters(); 135 init11Templates(); 136 137 is11HelpersLoaded = true; 138 139 } 140 } 141 142 145 private static void init11Formatters() { 146 querysetignorecacheformatter = new MessageFormat (helpers.getProperty(ejbQuerySetIgnoreCache_)); 148 149 c11formatter = new MessageFormat (helpers.getProperty(ejbCreate1_1_)); 151 c11unpkformatter = new MessageFormat (helpers.getProperty(ejbCreateUnknownPK1_1_)); 152 postc11formatter = new MessageFormat (helpers.getProperty(ejbPostCreate1_1_)); 153 l11formatter = new MessageFormat (helpers.getProperty(load1_1_)); 154 s11formatter = new MessageFormat (helpers.getProperty(store1_1_)); 155 assertpks11formatter = new MessageFormat (helpers.getProperty(assertPKStore1_1_)); 156 pks11formatter = new MessageFormat (helpers.getProperty(pkstore1_1_)); 157 pkstring11formatter = new MessageFormat (helpers.getProperty(pkstringstore1_1_)); 158 pkcopy11formatter = new MessageFormat (helpers.getProperty(pkcopystore1_1_)); 159 l11copyformatter = new MessageFormat (helpers.getProperty(copyload1_1_)); 160 s11copyformatter = new MessageFormat (helpers.getProperty(copystore1_1_)); 161 l11arrayformatter = new MessageFormat (helpers.getProperty(arrayload1_1_)); 162 s11arrayformatter = new MessageFormat (helpers.getProperty(arraystore1_1_)); 163 l11Serializableformatter = new MessageFormat (helpers.getProperty(loadSerializable1_1_)); 164 s11Serializableformatter = new MessageFormat (helpers.getProperty(storeSerializable1_1_)); 165 } 166 167 170 private static void init11Templates() { 171 one_oneVariablesTemplate = helpers.getProperty(one_oneVariables_); 172 ejbRemove1_1Template = helpers.getProperty(ejbRemove1_1_); 173 signature1_1Template = helpers.getProperty(signature1_1_); 174 } 175 } 176 | Popular Tags |