Class JspMethodExpression
java.lang.Object
jakarta.el.Expression
jakarta.el.MethodExpression
org.apache.jasper.el.JspMethodExpression
- All Implemented Interfaces:
Externalizable, Serializable
Wrapper around a MethodExpression that adds JSP-specific error tracking with marks.
Implements Externalizable for serialization support.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor required by Externalizable.JspMethodExpression(String mark, MethodExpression target) Creates a new JspMethodExpression wrapping the given target expression. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the original string representation of this EL expression as it was parsed.getMethodInfo(ELContext context) Returns information about the method that this expression resolves to.getMethodReference(ELContext context) Obtain theMethodReferencefor the method to which this method expression resolves.inthashCode()Invokes the method that this expression resolves to with the given parameters.booleanReturns whether this expression is a literal text expression, meaning it does not contain any variables, functions, or operators and evaluates to a constant value.booleanReturns whether the parameters for the method invocation are provided by the expression or by the container.voidvoid
-
Constructor Details
-
JspMethodExpression
public JspMethodExpression()Default constructor required by Externalizable. -
JspMethodExpression
Creates a new JspMethodExpression wrapping the given target expression.- Parameters:
mark- the mark for error trackingtarget- the underlying MethodExpression to wrap
-
-
Method Details
-
getMethodInfo
public MethodInfo getMethodInfo(ELContext context) throws NullPointerException, PropertyNotFoundException, MethodNotFoundException, ELException Description copied from class:jakarta.el.MethodExpressionReturns information about the method that this expression resolves to.- Specified by:
getMethodInfoin classMethodExpression- Parameters:
context- The EL context for this evaluation- Returns:
- Information about the method that this expression resolves to
- Throws:
NullPointerException- If the supplied context isnullPropertyNotFoundException- If a property/variable resolution failed because no match was found or a match was found but was not readableMethodNotFoundException- If no matching method can be foundELException- Wraps any exception throw whilst resolving the property
-
invoke
public Object invoke(ELContext context, Object[] params) throws NullPointerException, PropertyNotFoundException, MethodNotFoundException, ELException Description copied from class:jakarta.el.MethodExpressionInvokes the method that this expression resolves to with the given parameters.- Specified by:
invokein classMethodExpression- Parameters:
context- The EL context for this evaluationparams- The parameters with which to invoke this method expression- Returns:
- The result of invoking this method expression
- Throws:
NullPointerException- If the supplied context isnullPropertyNotFoundException- If a property/variable resolution failed because no match was found or a match was found but was not readableMethodNotFoundException- If no matching method can be foundELException- Wraps any exception throw whilst resolving the property or coercion of the result to the expected return type fails
-
getMethodReference
Description copied from class:jakarta.el.MethodExpressionObtain theMethodReferencefor the method to which this method expression resolves.- Overrides:
getMethodReferencein classMethodExpression- Parameters:
context- The EL context for this evaluation- Returns:
- This default implementation always returns
null
-
isParametersProvided
public boolean isParametersProvided()Description copied from class:jakarta.el.MethodExpressionReturns whether the parameters for the method invocation are provided by the expression or by the container.- Overrides:
isParametersProvidedin classMethodExpression- Returns:
- This default implementation always returns
false
-
equals
- Specified by:
equalsin classExpression
-
hashCode
public int hashCode()- Specified by:
hashCodein classExpression
-
getExpressionString
Description copied from class:jakarta.el.ExpressionReturns the original string representation of this EL expression as it was parsed.- Specified by:
getExpressionStringin classExpression- Returns:
- the string representation of this expression
-
isLiteralText
public boolean isLiteralText()Description copied from class:jakarta.el.ExpressionReturns whether this expression is a literal text expression, meaning it does not contain any variables, functions, or operators and evaluates to a constant value.- Specified by:
isLiteralTextin classExpression- Returns:
trueif this expression is a literal text,falseotherwise
-
writeExternal
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-