1 28 package org.jruby; 29 30 33 public interface Profile { 34 Profile ALL = new Profile() { 35 public boolean allowBuiltin(String name) { return true; } 36 public boolean allowClass(String name) { return true; } 37 public boolean allowModule(String name) { return true; } 38 public boolean allowLoad(String name) { return true; } 39 public boolean allowRequire(String name) { return true; } 40 }; 41 Profile DEBUG_ALLOW = new Profile() { 42 public boolean allowBuiltin(String name) { System.err.println("allowBuiltin("+name+")"); return true; } 43 public boolean allowClass(String name) { System.err.println("allowClass("+name+")"); return true; } 44 public boolean allowModule(String name) { System.err.println("allowModule("+name+")"); return true; } 45 public boolean allowLoad(String name) { System.err.println("allowLoad("+name+")"); return true; } 46 public boolean allowRequire(String name) { System.err.println("allowRequire("+name+")"); return true; } 47 }; 48 Profile NO_FILE_CLASS = new Profile() { 49 public boolean allowBuiltin(String name) { return true; } 50 public boolean allowClass(String name) { return !name.equals("File"); } 51 public boolean allowModule(String name) { return true; } 52 public boolean allowLoad(String name) { return true; } 53 public boolean allowRequire(String name) { return true; } 54 }; 55 Profile ANY = ALL; 56 Profile DEFAULT = ALL; 57 58 boolean allowBuiltin(String name); 59 boolean allowClass(String name); 60 boolean allowModule(String name); 61 boolean allowLoad(String name); 62 boolean allowRequire(String name); 63 } | Popular Tags |