Class MethodReference


  • public class MethodReference
    extends MethodInfo
    This encapsulates information about an EL method expression.
    Since:
    1.4, 2.5 also extends MethodInfo
    • Field Detail

      • NO_PARAMS

        public static final Object[] NO_PARAMS
        An object array representing "no method parameters".
    • Constructor Detail

      • MethodReference

        public MethodReference​(Object base,
                               Method method)
        Construct a method reference.
        Parameters:
        base - The base of the EL method expression.
        method - The concrete Method instance of the EL method expression.
      • MethodReference

        public MethodReference​(Object base,
                               Method method,
                               Object[] actualParameters,
                               boolean fromMethod)
        Construct a method reference.
        Parameters:
        base - The base of the EL method expression.
        method - The concrete Method instance of the EL method expression.
        actualParameters - The actual (evaluated) parameters of the method call.
        fromMethod - Whether this method reference is from an actual method call and not from a getter of a property.
    • Method Detail

      • getBase

        public Object getBase()
        Returns the base of the EL method expression. Usually, this is the backing bean on which the method behind getMethod() should be invoked.
        Returns:
        The base of the EL method expression.
      • getMethod

        public Method getMethod()
        Returns the concrete Method instance of the EL method expression. Usually, this is a method of the class behind getBase().
        Returns:
        The concrete Method instance of the EL method expression.
      • getActualParameters

        public Object[] getActualParameters()
        Returns the actual (evaluated) parameters of the method call. If there are no params, then this returns an empty array, never null. Those should be passed to Method.invoke(Object, Object...).
        Returns:
        The actual (evaluated) parameters of the method call.
      • isFromMethod

        public boolean isFromMethod()
        Returns true if this method reference is from an actual method call and not from a getter of a property.
        Returns:
        true if this method reference is from an actual method call and not from a getter of a property.