1 33 34 package bsh; 35 36 import bsh.Capabilities.Unavailable; 37 38 45 public abstract class ReflectManager 46 { 47 private static ReflectManager rfm; 48 49 53 public static ReflectManager getReflectManager() 54 throws Unavailable 55 { 56 if ( rfm == null ) 57 { 58 Class clas; 59 try { 60 clas = Class.forName( "bsh.reflect.ReflectManagerImpl" ); 61 rfm = (ReflectManager)clas.newInstance(); 62 } catch ( Exception e ) { 63 throw new Unavailable("Reflect Manager unavailable: "+e); 64 } 65 } 66 67 return rfm; 68 } 69 70 75 public static boolean RMSetAccessible( Object obj ) 76 throws Unavailable 77 { 78 return getReflectManager().setAccessible( obj ); 79 } 80 81 86 public abstract boolean setAccessible( Object o ); 87 } 88 89 | Popular Tags |