1 package org.bsf.smartValueObject.tools; 2 3 import java.util.Properties ; 4 5 12 public interface Instrumentor { 13 14 String VERSIONINTERFACE = "org.bsf.smartValueObject.Versionable"; 15 16 String VERSIONCLASS = "org.bsf.smartValueObject.Version"; 17 18 String VERSIONHELPER = "org.bsf.smartValueObject.VersionHelper"; 19 20 String VERSIONFIELD = "version"; 21 22 String VERSIONMETHOD = "touch"; 23 24 String DIRTYMETHOD = "isDirty"; 25 26 String CLEANMETHOD = "markClean"; 27 28 String DELETEDMETHOD = "isDeleted"; 29 30 String CREATEDMETHOD = "isCreated"; 31 32 String DELETEMETHOD = "delete"; 33 34 String CREATEMETHOD = "create"; 35 36 37 String SMARTCOLLECTION = "org.bsf.smartValueObject.container.SmartCollection"; 38 39 String SMARTMAP = "org.bsf.smartValueObject.container.SmartMap"; 40 41 String SMARTLIST = "org.bsf.smartValueObject.container.SmartList"; 42 43 String SMARTSET = "org.bsf.smartValueObject.container.SmartSet"; 44 45 46 Properties SMARTCONTAINERS = SmartReplacements.containerReplacementProps; 47 48 54 void modifyClass(String name) throws InstrumentorException; 55 void modifyClass(String basedir, String file) throws InstrumentorException; 56 57 63 byte[] getBytecode() throws InstrumentorException; 64 65 71 Class defineClass(); 72 73 public static class SmartReplacements { 74 private static final Properties containerReplacementProps = new Properties (); 75 static final String [][] containerReplacements = { 76 { "java.util.Collection", SMARTCOLLECTION }, 77 { "java.util.Map", SMARTMAP }, 78 { "java.util.List", SMARTLIST }, 79 { "java.util.Set", SMARTSET } 80 }; 81 82 static { 83 for (int i = 0; i < containerReplacements.length; i++) { 84 String [] containerReplacement = containerReplacements[i]; 85 containerReplacementProps.setProperty( 86 containerReplacement[0], 87 containerReplacement[1]); 88 } 89 } 90 } 91 } 92 | Popular Tags |