Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.commons.jxpath.functions
Class MethodFunction  view MethodFunction download MethodFunction.java

java.lang.Object
  extended byorg.apache.commons.jxpath.functions.MethodFunction
All Implemented Interfaces:
org.apache.commons.jxpath.Function

public class MethodFunction
extends java.lang.Object
implements org.apache.commons.jxpath.Function

An XPath extension function implemented as an individual Java method.

Version:
$Revision: 1.11 $ $Date: 2004/02/29 14:17:44 $

Field Summary
private static java.lang.Object[] EMPTY_ARRAY
           
private  java.lang.reflect.Method method
           
 
Constructor Summary
MethodFunction(java.lang.reflect.Method method)
           
 
Method Summary
 java.lang.Object invoke(org.apache.commons.jxpath.ExpressionContext context, java.lang.Object[] parameters)
          Computes the value of the function.
 java.lang.String toString()
          Convert this Object to a human-readable String.
 
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)
Method Detail

invoke

public java.lang.Object invoke(org.apache.commons.jxpath.ExpressionContext context,
                               java.lang.Object[] parameters)
Description copied from interface: org.apache.commons.jxpath.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 org.apache.commons.jxpath.Function

toString

public java.lang.String toString()
Description copied from class: java.lang.Object
Convert this Object to a human-readable String. There are no limits placed on how long this String should be or what it should contain. We suggest you make it as intuitive as possible to be able to place it into System.out.println() 55 and such.

It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.

This method will be called when performing string concatenation with this object. If the result is null, string concatenation will instead use "null".

The default implementation returns getClass().getName() + "@" + Integer.toHexString(hashCode()).