Package org.apache.jasper.runtime
Class ProtectedFunctionMapper
java.lang.Object
jakarta.el.FunctionMapper
org.apache.jasper.runtime.ProtectedFunctionMapper
- All Implemented Interfaces:
- FunctionMapper
Maps EL functions to their Java method counterparts. Keeps the actual Method
 objects protected so that JSP pages can't indirectly do reflection.
- Author:
- Mark Roth, Kin-man Chung
- 
Method SummaryModifier and TypeMethodDescriptionstatic ProtectedFunctionMapperGenerated Servlet and Tag Handler implementations call this method to retrieve an instance of the ProtectedFunctionMapper.static ProtectedFunctionMappergetMapForFunction(String fnQName, Class<?> c, String methodName, Class<?>[] args) Creates an instance for this class, and stores the Method for the given EL function prefix and name.voidmapFunction(String fnQName, Class<?> c, String methodName, Class<?>[] args) Stores a mapping from the given EL function prefix and name to the given Java method.resolveFunction(String prefix, String localName) Resolves the specified local name and prefix into a Java.lang.Method.Methods inherited from class jakarta.el.FunctionMappermapFunction
- 
Method Details- 
getInstanceGenerated Servlet and Tag Handler implementations call this method to retrieve an instance of the ProtectedFunctionMapper.- Returns:
- A new protected function mapper.
 
- 
mapFunctionStores a mapping from the given EL function prefix and name to the given Java method.- Parameters:
- fnQName- The EL function qualified name (including prefix)
- c- The class containing the Java method
- methodName- The name of the Java method
- args- The arguments of the Java method
- Throws:
- RuntimeException- if no method with the given signature could be found.
 
- 
getMapForFunctionpublic static ProtectedFunctionMapper getMapForFunction(String fnQName, Class<?> c, String methodName, Class<?>[] args) Creates an instance for this class, and stores the Method for the given EL function prefix and name. This method is used for the case when there is only one function in the EL expression.- Parameters:
- fnQName- The EL function qualified name (including prefix)
- c- The class containing the Java method
- methodName- The name of the Java method
- args- The arguments of the Java method
- Returns:
- the mapped function
- Throws:
- RuntimeException- if no method with the given signature could be found.
 
- 
resolveFunctionResolves the specified local name and prefix into a Java.lang.Method. Returns null if the prefix and local name are not found.- Specified by:
- resolveFunctionin interface- FunctionMapper
- Specified by:
- resolveFunctionin class- FunctionMapper
- Parameters:
- prefix- the prefix of the function
- localName- the short name of the function
- Returns:
- the result of the method mapping. Null means no entry found.
 
 
-