Package org.apache.el
Class MethodExpressionLiteral
- java.lang.Object
-
- jakarta.el.Expression
-
- jakarta.el.MethodExpression
-
- org.apache.el.MethodExpressionLiteral
-
- All Implemented Interfaces:
java.io.Externalizable,java.io.Serializable
public class MethodExpressionLiteral extends MethodExpression implements java.io.Externalizable
Literal method expression.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description MethodExpressionLiteral()Default constructor.MethodExpressionLiteral(java.lang.String expr, java.lang.Class<?> expectedType, java.lang.Class<?>[] paramTypes)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)java.lang.StringgetExpressionString()Returns the original string representation of this EL expression as it was parsed.MethodInfogetMethodInfo(ELContext context)Returns information about the method that this expression resolves to.MethodReferencegetMethodReference(ELContext context)Obtain theMethodReferencefor the method to which this method expression resolves.inthashCode()java.lang.Objectinvoke(ELContext context, java.lang.Object[] params)Invokes the method that this expression resolves to with the given parameters.booleanisLiteralText()Returns whether this expression is a literal text expression, meaning it does not contain any variables, functions, or operators and evaluates to a constant value.voidreadExternal(java.io.ObjectInput in)voidwriteExternal(java.io.ObjectOutput out)-
Methods inherited from class jakarta.el.MethodExpression
isParametersProvided
-
-
-
-
Constructor Detail
-
MethodExpressionLiteral
public MethodExpressionLiteral()
Default constructor.
-
MethodExpressionLiteral
public MethodExpressionLiteral(java.lang.String expr, java.lang.Class<?> expectedType, java.lang.Class<?>[] paramTypes)Constructor.- Parameters:
expr- the expressionexpectedType- the expected typeparamTypes- the parameter types
-
-
Method Detail
-
getMethodInfo
public MethodInfo getMethodInfo(ELContext context) throws 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:
PropertyNotFoundException- 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 java.lang.Object invoke(ELContext context, java.lang.Object[] params) throws 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:
PropertyNotFoundException- 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
public MethodReference getMethodReference(ELContext context)
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
-
getExpressionString
public java.lang.String 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
-
equals
public boolean equals(java.lang.Object obj)
- Specified by:
equalsin classExpression
-
hashCode
public int hashCode()
- Specified by:
hashCodein classExpression
-
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
-
readExternal
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException- Specified by:
readExternalin interfacejava.io.Externalizable- Throws:
java.io.IOExceptionjava.lang.ClassNotFoundException
-
writeExternal
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException- Specified by:
writeExternalin interfacejava.io.Externalizable- Throws:
java.io.IOException
-
-