public class SecureIntrospectorImpl extends Introspector implements SecureIntrospectorControl
Prevent "dangerous" classloader/reflection related calls. Use this introspector for situations in which template writers are numerous or untrusted. Specifically, this introspector prevents creation of arbitrary objects and prevents reflection on objects.
See documentation of checkObjectExecutePermission() for more information on specific classes and methods blocked.
log| 构造器和说明 |
|---|
SecureIntrospectorImpl(java.lang.String[] badClasses,
java.lang.String[] badPackages,
Log log) |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
checkObjectExecutePermission(java.lang.Class clazz,
java.lang.String methodName)
Determine which methods and classes to prevent from executing.
|
java.lang.reflect.Method |
getMethod(java.lang.Class clazz,
java.lang.String methodName,
java.lang.Object[] params)
Get the Method object corresponding to the given class, name and parameters.
|
getIntrospectorCachepublic SecureIntrospectorImpl(java.lang.String[] badClasses,
java.lang.String[] badPackages,
Log log)
public java.lang.reflect.Method getMethod(java.lang.Class clazz,
java.lang.String methodName,
java.lang.Object[] params)
throws java.lang.IllegalArgumentException
getMethod 在类中 Introspectorclazz - Class on which method will be calledmethodName - Name of method to be calledparams - array of parameters to methodjava.lang.IllegalArgumentException - The parameter passed in were incorrect.public boolean checkObjectExecutePermission(java.lang.Class clazz,
java.lang.String methodName)
introspector.restrict.classes
and introspector.restrict.packages.checkObjectExecutePermission 在接口中 SecureIntrospectorControlclazz - Class on which method will be calledmethodName - Name of method to be calledSecureIntrospectorControl.checkObjectExecutePermission(java.lang.Class, java.lang.String)