Class MethodFunction

  • All Implemented Interfaces:
    Function

    public class MethodFunction
    extends java.lang.Object
    implements Function
    An XPath extension function implemented as an individual Java method.
    Version:
    $Revision: 652845 $ $Date: 2008-05-02 12:46:46 -0500 (Fri, 02 May 2008) $
    Author:
    Dmitri Plotnikov
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.lang.Object[] EMPTY_ARRAY  
      private java.lang.reflect.Method method  
    • Constructor Summary

      Constructors 
      Constructor Description
      MethodFunction​(java.lang.reflect.Method method)
      Create a new MethodFunction.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object invoke​(ExpressionContext context, java.lang.Object[] parameters)
      Computes the value of the function.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • method

        private java.lang.reflect.Method method
      • EMPTY_ARRAY

        private static final java.lang.Object[] EMPTY_ARRAY
    • Constructor Detail

      • MethodFunction

        public MethodFunction​(java.lang.reflect.Method method)
        Create a new MethodFunction.
        Parameters:
        method - implementing Method
    • Method Detail

      • invoke

        public java.lang.Object invoke​(ExpressionContext context,
                                       java.lang.Object[] parameters)
        Description copied from interface: Function
        Computes the value of the function. Each implementation of Function is responsible for conversion of supplied parameters to the required argument types.
        Specified by:
        invoke in interface Function
        Parameters:
        context - can be used to acquire the context in which the function is being evaluted.
        parameters - function arguments
        Returns:
        Object result
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object