1 21 package oracle.toplink.essentials.internal.security; 23 24 import java.security.PrivilegedExceptionAction ; 25 26 public class PrivilegedGetField implements PrivilegedExceptionAction { 27 28 private Class javaClass; 29 private String fieldName; 30 private boolean shouldSetAccessible; 31 32 33 public PrivilegedGetField(Class javaClass, String fieldName, boolean shouldSetAccessible) { 34 this.javaClass = javaClass; 35 this.fieldName = fieldName; 36 this.shouldSetAccessible = shouldSetAccessible; 37 } 38 39 public Object run() throws NoSuchFieldException { 40 return PrivilegedAccessHelper.getField(javaClass, fieldName, shouldSetAccessible); 41 } 42 } 43 44 45 | Popular Tags |