jfun.yan.xml
Class DelegatingNutsFunction

java.lang.Object
  extended by jfun.yan.xml.DelegatingNutsFunction
All Implemented Interfaces:
java.io.Serializable, LocationAware, NutsFunction
Direct Known Subclasses:
SynchronizedNutsFunction

public class DelegatingNutsFunction
extends java.lang.Object
implements NutsFunction

This is the super class for conveniently delegating to another NutsFunction object. This class does nothing but forwarding the call to the delegate target.

Subclass can override any method to provide custom behavior.

Author:
Ben Yu Nov 27, 2005 11:45:45 AM
See Also:
Serialized Form

Constructor Summary
DelegatingNutsFunction(NutsFunction fun)
          Create a DelegatingNutsFunction object.
 
Method Summary
 java.lang.Object call(java.lang.Object[] args)
          Call the function with arguments.
 boolean equals(java.lang.Object obj)
           
 NutsFunction getDelegateTarget()
          To get the delegate target.
 Location getLocation()
           
 java.lang.String getName()
          Get the function name.
 int getParameterCount()
          Get the number of parameters expected.
 java.lang.String[] getParameterNames()
          Get the names of the parameters.
 java.lang.Class getReturnType()
          Get the return type of the function.
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DelegatingNutsFunction

public DelegatingNutsFunction(NutsFunction fun)
Create a DelegatingNutsFunction object.

Parameters:
fun - the delegate target.
Method Detail

getParameterNames

public java.lang.String[] getParameterNames()
Description copied from interface: NutsFunction
Get the names of the parameters.

Specified by:
getParameterNames in interface NutsFunction

getDelegateTarget

public NutsFunction getDelegateTarget()
To get the delegate target.


call

public java.lang.Object call(java.lang.Object[] args)
Description copied from interface: NutsFunction
Call the function with arguments.

Specified by:
call in interface NutsFunction
Parameters:
args - the arguments.
Returns:
the return value.

getLocation

public Location getLocation()
Specified by:
getLocation in interface LocationAware

getName

public java.lang.String getName()
Description copied from interface: NutsFunction
Get the function name.

Specified by:
getName in interface NutsFunction
Returns:
the name.

getParameterCount

public int getParameterCount()
Description copied from interface: NutsFunction
Get the number of parameters expected.

Specified by:
getParameterCount in interface NutsFunction

getReturnType

public java.lang.Class getReturnType()
Description copied from interface: NutsFunction
Get the return type of the function. Null is returned if unknown.

Specified by:
getReturnType in interface NutsFunction

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

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