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.
author: Will Glass-Husain version: $Id: SecureIntrospectorImpl.java 509906 2007-02-21 06:11:05Z wglass $
getMethod(Class clazz, String methodName, Object[] params) Get the Method object corresponding to the given class, name and parameters.
Constructor Detail
SecureIntrospectorImpl
public SecureIntrospectorImpl(String[] badClasses, String[] badPackages, Log log)(Code)
Method Detail
checkObjectExecutePermission
public boolean checkObjectExecutePermission(Class clazz, String methodName)(Code)
Determine which methods and classes to prevent from executing. Always blocks
methods wait() and notify(). Always allows methods on Number, Boolean, and String.
Prohibits method calls on classes related to reflection and system operations.
For the complete list, see the properties introspector.restrict.classes
and introspector.restrict.packages.
Parameters: clazz - Class on which method will be called Parameters: methodName - Name of method to be called See Also:org.apache.velocity.util.introspection.SecureIntrospectorControl.checkObjectExecutePermission(java.lang.Classjava.lang.String)
Get the Method object corresponding to the given class, name and parameters.
Will check for appropriate execute permissions and return null if the method
is not allowed to be executed.
Parameters: clazz - Class on which method will be called Parameters: methodName - Name of method to be called Parameters: params - array of parameters to method Method object retrieved by Introspector throws: IllegalArgumentException - The parameter passed in were incorrect.
Fields inherited from org.apache.velocity.util.introspection.Introspector