1 5 package org.easymock.classextension.internal; 6 7 10 public class ClassInstantiatorFactory { 11 12 private ClassInstantiatorFactory() { 14 } 15 16 18 23 public static String getJVM() { 24 return System.getProperty("java.vm.specification.vendor"); 25 } 26 27 32 public static String getJVMSpecificationVersion() { 33 return System.getProperty("java.specification.version"); 34 } 35 36 public static boolean isSunJVM() { 37 return getJVM().equals("Sun Microsystems Inc."); 38 } 39 40 public static boolean is1_3Specifications() { 41 return getJVMSpecificationVersion().equals("1.3"); 42 } 43 44 49 public static IClassInstantiator getInstantiator() { 50 if (isSunJVM() && !is1_3Specifications()) { 53 return new SunClassInstantiator(); 54 } 55 return new DefaultClassInstantiator(); 56 } 57 } 58 | Popular Tags |