Tea Java Runtime API
Version 3.1.0

com.pdmfc.tea.runtime
Class SJavaFunction

java.lang.Object
  |
  +--com.pdmfc.tea.runtime.SJavaFunction
All Implemented Interfaces:
SObjFunction

public class SJavaFunction
extends java.lang.Object
implements SObjFunction

A Tea function implemented as a Java method.


Method Summary
 java.lang.Object exec(SObjFunction obj, SContext context, java.lang.Object[] args)
          Executes the command.
static SObjFunction newFunction(java.lang.Class javaClass, java.lang.String javaMethodName)
          Creates a Tea function implemented as a Java class method.
static SObjFunction newFunction(java.lang.Object target, java.lang.String javaMethodName)
          Creates a Tea function implemented as a Java instance method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

newFunction

public static SObjFunction newFunction(java.lang.Object target,
                                       java.lang.String javaMethodName)
Creates a Tea function implemented as a Java instance method. Whenever the Tea function is called the method named javaMethodName will be invoked on the object referenced by targe.
Parameters:
target - The object that will have its javaMethodName method invoked when the Tea function is executed.
javaMethodName - The name of the java method to call on the target object when the Tea function is executed.
Returns:
An object representing a Tea function that when executed will invoke the javaMethodName method on the target object.

newFunction

public static SObjFunction newFunction(java.lang.Class javaClass,
                                       java.lang.String javaMethodName)
Creates a Tea function implemented as a Java class method. Whenever the Tea function is called the static method named javaMethodName will be invoked on javaClass class.
Parameters:
javaClass - The Java class object that will have its static javaMethodName method invoked when the Tea function is executed.
javaMethodName - The name of the static Java method to call on the javaClass class when the Tea function is executed.
Returns:
An object representing a Tea function that when executed will invoke the javaMethodName static method on the javaClass class.

exec

public java.lang.Object exec(SObjFunction obj,
                             SContext context,
                             java.lang.Object[] args)
                      throws STeaException
Description copied from interface: SObjFunction
Executes the command.
Specified by:
exec in interface SObjFunction
Following copied from interface: com.pdmfc.tea.runtime.SObjFunction
Parameters:
func - The SObjFunction that led to call this function. Most of the time is the same as the this object.
context - The context where the command should be executed.
args - Array with the arguments passed to the command.
Returns:
An Object object.
Throws:
STeaException - Thrown if there were problems executing the command.

Tea Java Runtime API
Version 3.1.0

© 2002 PDM&FC, All Rights Reserved.