Beispiel #1
0
 JavaMembers(Scriptable scope, Class<?> cl, boolean includeProtected) {
   try {
     Context cx = ContextFactory.getGlobal().enterContext();
     ClassShutter shutter = cx.getClassShutter();
     if (shutter != null && !shutter.visibleToScripts(cl.getName())) {
       throw Context.reportRuntimeError1("msg.access.prohibited", cl.getName());
     }
     this.includePrivate = cx.hasFeature(Context.FEATURE_ENHANCED_JAVA_ACCESS);
     this.members = new HashMap<String, Object>();
     this.staticMembers = new HashMap<String, Object>();
     this.cl = cl;
     reflect(scope, includeProtected);
   } finally {
     Context.exit();
   }
 }